diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/CTerrainTriangleSelector.h | 200 |
1 files changed, 100 insertions, 100 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/CTerrainTriangleSelector.h b/libraries/irrlicht-1.8/source/Irrlicht/CTerrainTriangleSelector.h index f452a2e..e0c6545 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/CTerrainTriangleSelector.h +++ b/libraries/irrlicht-1.8/source/Irrlicht/CTerrainTriangleSelector.h | |||
@@ -1,100 +1,100 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | 1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt |
2 | // This file is part of the "Irrlicht Engine". | 2 | // This file is part of the "Irrlicht Engine". |
3 | // For conditions of distribution and use, see copyright notice in irrlicht.h | 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h |
4 | 4 | ||
5 | // The code for the TerrainTriangleSelector is based on the GeoMipMapSelector | 5 | // The code for the TerrainTriangleSelector is based on the GeoMipMapSelector |
6 | // developed by Spintz. He made it available for Irrlicht and allowed it to be | 6 | // developed by Spintz. He made it available for Irrlicht and allowed it to be |
7 | // distributed under this licence. I only modified some parts. A lot of thanks go to him. | 7 | // distributed under this licence. I only modified some parts. A lot of thanks go to him. |
8 | 8 | ||
9 | #ifndef __C_TERRAIN_TRIANGLE_SELECTOR_H__ | 9 | #ifndef __C_TERRAIN_TRIANGLE_SELECTOR_H__ |
10 | #define __C_TERRAIN_TRIANGLE_SELECTOR_H__ | 10 | #define __C_TERRAIN_TRIANGLE_SELECTOR_H__ |
11 | 11 | ||
12 | #include "ITriangleSelector.h" | 12 | #include "ITriangleSelector.h" |
13 | #include "irrArray.h" | 13 | #include "irrArray.h" |
14 | 14 | ||
15 | namespace irr | 15 | namespace irr |
16 | { | 16 | { |
17 | namespace scene | 17 | namespace scene |
18 | { | 18 | { |
19 | 19 | ||
20 | class ITerrainSceneNode; | 20 | class ITerrainSceneNode; |
21 | 21 | ||
22 | //! Triangle Selector for the TerrainSceneNode | 22 | //! Triangle Selector for the TerrainSceneNode |
23 | /** The code for the TerrainTriangleSelector is based on the GeoMipMapSelector | 23 | /** The code for the TerrainTriangleSelector is based on the GeoMipMapSelector |
24 | developed by Spintz. He made it available for Irrlicht and allowed it to be | 24 | developed by Spintz. He made it available for Irrlicht and allowed it to be |
25 | distributed under this licence. I only modified some parts. A lot of thanks go | 25 | distributed under this licence. I only modified some parts. A lot of thanks go |
26 | to him. | 26 | to him. |
27 | */ | 27 | */ |
28 | class CTerrainTriangleSelector : public ITriangleSelector | 28 | class CTerrainTriangleSelector : public ITriangleSelector |
29 | { | 29 | { |
30 | public: | 30 | public: |
31 | 31 | ||
32 | //! Constructs a selector based on an ITerrainSceneNode | 32 | //! Constructs a selector based on an ITerrainSceneNode |
33 | CTerrainTriangleSelector(ITerrainSceneNode* node, s32 LOD); | 33 | CTerrainTriangleSelector(ITerrainSceneNode* node, s32 LOD); |
34 | 34 | ||
35 | //! Destructor | 35 | //! Destructor |
36 | virtual ~CTerrainTriangleSelector(); | 36 | virtual ~CTerrainTriangleSelector(); |
37 | 37 | ||
38 | //! Clears and sets triangle data | 38 | //! Clears and sets triangle data |
39 | virtual void setTriangleData (ITerrainSceneNode* node, s32 LOD); | 39 | virtual void setTriangleData (ITerrainSceneNode* node, s32 LOD); |
40 | 40 | ||
41 | //! Gets all triangles. | 41 | //! Gets all triangles. |
42 | void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount, | 42 | void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount, |
43 | const core::matrix4* transform=0) const; | 43 | const core::matrix4* transform=0) const; |
44 | 44 | ||
45 | //! Gets all triangles which lie within a specific bounding box. | 45 | //! Gets all triangles which lie within a specific bounding box. |
46 | void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount, | 46 | void getTriangles(core::triangle3df* triangles, s32 arraySize, s32& outTriangleCount, |
47 | const core::aabbox3d<f32>& box, const core::matrix4* transform=0) const; | 47 | const core::aabbox3d<f32>& box, const core::matrix4* transform=0) const; |
48 | 48 | ||
49 | //! Gets all triangles which have or may have contact with a 3d line. | 49 | //! Gets all triangles which have or may have contact with a 3d line. |
50 | virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, | 50 | virtual void getTriangles(core::triangle3df* triangles, s32 arraySize, |
51 | s32& outTriangleCount, const core::line3d<f32>& line, | 51 | s32& outTriangleCount, const core::line3d<f32>& line, |
52 | const core::matrix4* transform=0) const; | 52 | const core::matrix4* transform=0) const; |
53 | 53 | ||
54 | //! Returns amount of all available triangles in this selector | 54 | //! Returns amount of all available triangles in this selector |
55 | virtual s32 getTriangleCount() const; | 55 | virtual s32 getTriangleCount() const; |
56 | 56 | ||
57 | //! Return the scene node associated with a given triangle. | 57 | //! Return the scene node associated with a given triangle. |
58 | virtual ISceneNode* getSceneNodeForTriangle(u32 triangleIndex) const; | 58 | virtual ISceneNode* getSceneNodeForTriangle(u32 triangleIndex) const; |
59 | 59 | ||
60 | // Get the number of TriangleSelectors that are part of this one | 60 | // Get the number of TriangleSelectors that are part of this one |
61 | virtual u32 getSelectorCount() const; | 61 | virtual u32 getSelectorCount() const; |
62 | 62 | ||
63 | // Get the TriangleSelector based on index based on getSelectorCount | 63 | // Get the TriangleSelector based on index based on getSelectorCount |
64 | virtual ITriangleSelector* getSelector(u32 index); | 64 | virtual ITriangleSelector* getSelector(u32 index); |
65 | 65 | ||
66 | // Get the TriangleSelector based on index based on getSelectorCount | 66 | // Get the TriangleSelector based on index based on getSelectorCount |
67 | virtual const ITriangleSelector* getSelector(u32 index) const; | 67 | virtual const ITriangleSelector* getSelector(u32 index) const; |
68 | 68 | ||
69 | private: | 69 | private: |
70 | 70 | ||
71 | friend class CTerrainSceneNode; | 71 | friend class CTerrainSceneNode; |
72 | 72 | ||
73 | struct SGeoMipMapTrianglePatch | 73 | struct SGeoMipMapTrianglePatch |
74 | { | 74 | { |
75 | core::array<core::triangle3df> Triangles; | 75 | core::array<core::triangle3df> Triangles; |
76 | s32 NumTriangles; | 76 | s32 NumTriangles; |
77 | core::aabbox3df Box; | 77 | core::aabbox3df Box; |
78 | }; | 78 | }; |
79 | 79 | ||
80 | struct SGeoMipMapTrianglePatches | 80 | struct SGeoMipMapTrianglePatches |
81 | { | 81 | { |
82 | SGeoMipMapTrianglePatches() : | 82 | SGeoMipMapTrianglePatches() : |
83 | NumPatches(0), TotalTriangles(0) | 83 | NumPatches(0), TotalTriangles(0) |
84 | { | 84 | { |
85 | } | 85 | } |
86 | 86 | ||
87 | core::array<SGeoMipMapTrianglePatch> TrianglePatchArray; | 87 | core::array<SGeoMipMapTrianglePatch> TrianglePatchArray; |
88 | s32 NumPatches; | 88 | s32 NumPatches; |
89 | u32 TotalTriangles; | 89 | u32 TotalTriangles; |
90 | }; | 90 | }; |
91 | 91 | ||
92 | ITerrainSceneNode* SceneNode; | 92 | ITerrainSceneNode* SceneNode; |
93 | SGeoMipMapTrianglePatches TrianglePatches; | 93 | SGeoMipMapTrianglePatches TrianglePatches; |
94 | }; | 94 | }; |
95 | 95 | ||
96 | } // end namespace scene | 96 | } // end namespace scene |
97 | } // end namespace irr | 97 | } // end namespace irr |
98 | 98 | ||
99 | 99 | ||
100 | #endif // __C_TERRAIN_TRIANGLE_SELECTOR_H__ | 100 | #endif // __C_TERRAIN_TRIANGLE_SELECTOR_H__ |