diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/irrlicht-1.8/include/IDynamicMeshBuffer.h | 422 |
1 files changed, 211 insertions, 211 deletions
diff --git a/libraries/irrlicht-1.8/include/IDynamicMeshBuffer.h b/libraries/irrlicht-1.8/include/IDynamicMeshBuffer.h index 72f2036..24434df 100644 --- a/libraries/irrlicht-1.8/include/IDynamicMeshBuffer.h +++ b/libraries/irrlicht-1.8/include/IDynamicMeshBuffer.h | |||
@@ -1,211 +1,211 @@ | |||
1 | // Copyright (C) 2008-2012 Nikolaus Gebhardt | 1 | // Copyright (C) 2008-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 | #ifndef __I_DYNAMIC_MESH_BUFFER_H_INCLUDED__ | 5 | #ifndef __I_DYNAMIC_MESH_BUFFER_H_INCLUDED__ |
6 | #define __I_DYNAMIC_MESH_BUFFER_H_INCLUDED__ | 6 | #define __I_DYNAMIC_MESH_BUFFER_H_INCLUDED__ |
7 | 7 | ||
8 | #include "IMeshBuffer.h" | 8 | #include "IMeshBuffer.h" |
9 | #include "IVertexBuffer.h" | 9 | #include "IVertexBuffer.h" |
10 | #include "IIndexBuffer.h" | 10 | #include "IIndexBuffer.h" |
11 | 11 | ||
12 | namespace irr | 12 | namespace irr |
13 | { | 13 | { |
14 | namespace scene | 14 | namespace scene |
15 | { | 15 | { |
16 | 16 | ||
17 | /** a dynamic meshBuffer */ | 17 | /** a dynamic meshBuffer */ |
18 | class IDynamicMeshBuffer : public IMeshBuffer | 18 | class IDynamicMeshBuffer : public IMeshBuffer |
19 | { | 19 | { |
20 | public: | 20 | public: |
21 | virtual IVertexBuffer &getVertexBuffer() const =0; | 21 | virtual IVertexBuffer &getVertexBuffer() const =0; |
22 | virtual IIndexBuffer &getIndexBuffer() const =0; | 22 | virtual IIndexBuffer &getIndexBuffer() const =0; |
23 | 23 | ||
24 | virtual void setVertexBuffer(IVertexBuffer *vertexBuffer) =0; | 24 | virtual void setVertexBuffer(IVertexBuffer *vertexBuffer) =0; |
25 | virtual void setIndexBuffer(IIndexBuffer *indexBuffer) =0; | 25 | virtual void setIndexBuffer(IIndexBuffer *indexBuffer) =0; |
26 | 26 | ||
27 | //! Get the material of this meshbuffer | 27 | //! Get the material of this meshbuffer |
28 | /** \return Material of this buffer. */ | 28 | /** \return Material of this buffer. */ |
29 | virtual video::SMaterial& getMaterial() =0; | 29 | virtual video::SMaterial& getMaterial() =0; |
30 | 30 | ||
31 | //! Get the material of this meshbuffer | 31 | //! Get the material of this meshbuffer |
32 | /** \return Material of this buffer. */ | 32 | /** \return Material of this buffer. */ |
33 | virtual const video::SMaterial& getMaterial() const =0; | 33 | virtual const video::SMaterial& getMaterial() const =0; |
34 | 34 | ||
35 | //! Get the axis aligned bounding box of this meshbuffer. | 35 | //! Get the axis aligned bounding box of this meshbuffer. |
36 | /** \return Axis aligned bounding box of this buffer. */ | 36 | /** \return Axis aligned bounding box of this buffer. */ |
37 | virtual const core::aabbox3df& getBoundingBox() const =0; | 37 | virtual const core::aabbox3df& getBoundingBox() const =0; |
38 | 38 | ||
39 | //! Set axis aligned bounding box | 39 | //! Set axis aligned bounding box |
40 | /** \param box User defined axis aligned bounding box to use | 40 | /** \param box User defined axis aligned bounding box to use |
41 | for this buffer. */ | 41 | for this buffer. */ |
42 | virtual void setBoundingBox(const core::aabbox3df& box) =0; | 42 | virtual void setBoundingBox(const core::aabbox3df& box) =0; |
43 | 43 | ||
44 | //! Recalculates the bounding box. Should be called if the mesh changed. | 44 | //! Recalculates the bounding box. Should be called if the mesh changed. |
45 | virtual void recalculateBoundingBox() =0; | 45 | virtual void recalculateBoundingBox() =0; |
46 | 46 | ||
47 | //! Append the vertices and indices to the current buffer | 47 | //! Append the vertices and indices to the current buffer |
48 | /** Only works for compatible vertex types. | 48 | /** Only works for compatible vertex types. |
49 | \param vertices Pointer to a vertex array. | 49 | \param vertices Pointer to a vertex array. |
50 | \param numVertices Number of vertices in the array. | 50 | \param numVertices Number of vertices in the array. |
51 | \param indices Pointer to index array. | 51 | \param indices Pointer to index array. |
52 | \param numIndices Number of indices in array. */ | 52 | \param numIndices Number of indices in array. */ |
53 | virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) | 53 | virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) |
54 | { | 54 | { |
55 | 55 | ||
56 | } | 56 | } |
57 | 57 | ||
58 | //! Append the meshbuffer to the current buffer | 58 | //! Append the meshbuffer to the current buffer |
59 | /** Only works for compatible vertex types | 59 | /** Only works for compatible vertex types |
60 | \param other Buffer to append to this one. */ | 60 | \param other Buffer to append to this one. */ |
61 | virtual void append(const IMeshBuffer* const other) | 61 | virtual void append(const IMeshBuffer* const other) |
62 | { | 62 | { |
63 | 63 | ||
64 | } | 64 | } |
65 | 65 | ||
66 | // ------------------- To be removed? ------------------- // | 66 | // ------------------- To be removed? ------------------- // |
67 | 67 | ||
68 | //! get the current hardware mapping hint | 68 | //! get the current hardware mapping hint |
69 | virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const | 69 | virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const |
70 | { | 70 | { |
71 | return getVertexBuffer().getHardwareMappingHint(); | 71 | return getVertexBuffer().getHardwareMappingHint(); |
72 | } | 72 | } |
73 | 73 | ||
74 | //! get the current hardware mapping hint | 74 | //! get the current hardware mapping hint |
75 | virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const | 75 | virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const |
76 | { | 76 | { |
77 | return getIndexBuffer().getHardwareMappingHint(); | 77 | return getIndexBuffer().getHardwareMappingHint(); |
78 | } | 78 | } |
79 | 79 | ||
80 | //! set the hardware mapping hint, for driver | 80 | //! set the hardware mapping hint, for driver |
81 | virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX ) | 81 | virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX ) |
82 | { | 82 | { |
83 | if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX) | 83 | if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX) |
84 | getVertexBuffer().setHardwareMappingHint(NewMappingHint); | 84 | getVertexBuffer().setHardwareMappingHint(NewMappingHint); |
85 | if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX) | 85 | if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX) |
86 | getIndexBuffer().setHardwareMappingHint(NewMappingHint); | 86 | getIndexBuffer().setHardwareMappingHint(NewMappingHint); |
87 | } | 87 | } |
88 | 88 | ||
89 | //! flags the mesh as changed, reloads hardware buffers | 89 | //! flags the mesh as changed, reloads hardware buffers |
90 | virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX) | 90 | virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX) |
91 | { | 91 | { |
92 | if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX) | 92 | if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX) |
93 | getVertexBuffer().setDirty(); | 93 | getVertexBuffer().setDirty(); |
94 | if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX) | 94 | if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX) |
95 | getIndexBuffer().setDirty(); | 95 | getIndexBuffer().setDirty(); |
96 | } | 96 | } |
97 | 97 | ||
98 | virtual u32 getChangedID_Vertex() const | 98 | virtual u32 getChangedID_Vertex() const |
99 | { | 99 | { |
100 | return getVertexBuffer().getChangedID(); | 100 | return getVertexBuffer().getChangedID(); |
101 | } | 101 | } |
102 | 102 | ||
103 | virtual u32 getChangedID_Index() const | 103 | virtual u32 getChangedID_Index() const |
104 | { | 104 | { |
105 | return getIndexBuffer().getChangedID(); | 105 | return getIndexBuffer().getChangedID(); |
106 | } | 106 | } |
107 | 107 | ||
108 | // ------------------- Old interface ------------------- // | 108 | // ------------------- Old interface ------------------- // |
109 | 109 | ||
110 | //! Get type of vertex data which is stored in this meshbuffer. | 110 | //! Get type of vertex data which is stored in this meshbuffer. |
111 | /** \return Vertex type of this buffer. */ | 111 | /** \return Vertex type of this buffer. */ |
112 | virtual video::E_VERTEX_TYPE getVertexType() const | 112 | virtual video::E_VERTEX_TYPE getVertexType() const |
113 | { | 113 | { |
114 | return getVertexBuffer().getType(); | 114 | return getVertexBuffer().getType(); |
115 | } | 115 | } |
116 | 116 | ||
117 | //! Get access to vertex data. The data is an array of vertices. | 117 | //! Get access to vertex data. The data is an array of vertices. |
118 | /** Which vertex type is used can be determined by getVertexType(). | 118 | /** Which vertex type is used can be determined by getVertexType(). |
119 | \return Pointer to array of vertices. */ | 119 | \return Pointer to array of vertices. */ |
120 | virtual const void* getVertices() const | 120 | virtual const void* getVertices() const |
121 | { | 121 | { |
122 | return getVertexBuffer().getData(); | 122 | return getVertexBuffer().getData(); |
123 | } | 123 | } |
124 | 124 | ||
125 | //! Get access to vertex data. The data is an array of vertices. | 125 | //! Get access to vertex data. The data is an array of vertices. |
126 | /** Which vertex type is used can be determined by getVertexType(). | 126 | /** Which vertex type is used can be determined by getVertexType(). |
127 | \return Pointer to array of vertices. */ | 127 | \return Pointer to array of vertices. */ |
128 | virtual void* getVertices() | 128 | virtual void* getVertices() |
129 | { | 129 | { |
130 | return getVertexBuffer().getData(); | 130 | return getVertexBuffer().getData(); |
131 | } | 131 | } |
132 | 132 | ||
133 | //! Get amount of vertices in meshbuffer. | 133 | //! Get amount of vertices in meshbuffer. |
134 | /** \return Number of vertices in this buffer. */ | 134 | /** \return Number of vertices in this buffer. */ |
135 | virtual u32 getVertexCount() const | 135 | virtual u32 getVertexCount() const |
136 | { | 136 | { |
137 | return getVertexBuffer().size(); | 137 | return getVertexBuffer().size(); |
138 | } | 138 | } |
139 | 139 | ||
140 | //! Get type of index data which is stored in this meshbuffer. | 140 | //! Get type of index data which is stored in this meshbuffer. |
141 | /** \return Index type of this buffer. */ | 141 | /** \return Index type of this buffer. */ |
142 | virtual video::E_INDEX_TYPE getIndexType() const | 142 | virtual video::E_INDEX_TYPE getIndexType() const |
143 | { | 143 | { |
144 | return getIndexBuffer().getType(); | 144 | return getIndexBuffer().getType(); |
145 | } | 145 | } |
146 | 146 | ||
147 | //! Get access to Indices. | 147 | //! Get access to Indices. |
148 | /** \return Pointer to indices array. */ | 148 | /** \return Pointer to indices array. */ |
149 | virtual const u16* getIndices() const | 149 | virtual const u16* getIndices() const |
150 | { | 150 | { |
151 | return (u16*)getIndexBuffer().getData(); | 151 | return (u16*)getIndexBuffer().getData(); |
152 | } | 152 | } |
153 | 153 | ||
154 | //! Get access to Indices. | 154 | //! Get access to Indices. |
155 | /** \return Pointer to indices array. */ | 155 | /** \return Pointer to indices array. */ |
156 | virtual u16* getIndices() | 156 | virtual u16* getIndices() |
157 | { | 157 | { |
158 | return (u16*)getIndexBuffer().getData(); | 158 | return (u16*)getIndexBuffer().getData(); |
159 | } | 159 | } |
160 | 160 | ||
161 | //! Get amount of indices in this meshbuffer. | 161 | //! Get amount of indices in this meshbuffer. |
162 | /** \return Number of indices in this buffer. */ | 162 | /** \return Number of indices in this buffer. */ |
163 | virtual u32 getIndexCount() const | 163 | virtual u32 getIndexCount() const |
164 | { | 164 | { |
165 | return getIndexBuffer().size(); | 165 | return getIndexBuffer().size(); |
166 | } | 166 | } |
167 | 167 | ||
168 | //! returns position of vertex i | 168 | //! returns position of vertex i |
169 | virtual const core::vector3df& getPosition(u32 i) const | 169 | virtual const core::vector3df& getPosition(u32 i) const |
170 | { | 170 | { |
171 | return getVertexBuffer()[i].Pos; | 171 | return getVertexBuffer()[i].Pos; |
172 | } | 172 | } |
173 | 173 | ||
174 | //! returns position of vertex i | 174 | //! returns position of vertex i |
175 | virtual core::vector3df& getPosition(u32 i) | 175 | virtual core::vector3df& getPosition(u32 i) |
176 | { | 176 | { |
177 | return getVertexBuffer()[i].Pos; | 177 | return getVertexBuffer()[i].Pos; |
178 | } | 178 | } |
179 | 179 | ||
180 | //! returns texture coords of vertex i | 180 | //! returns texture coords of vertex i |
181 | virtual const core::vector2df& getTCoords(u32 i) const | 181 | virtual const core::vector2df& getTCoords(u32 i) const |
182 | { | 182 | { |
183 | return getVertexBuffer()[i].TCoords; | 183 | return getVertexBuffer()[i].TCoords; |
184 | } | 184 | } |
185 | 185 | ||
186 | //! returns texture coords of vertex i | 186 | //! returns texture coords of vertex i |
187 | virtual core::vector2df& getTCoords(u32 i) | 187 | virtual core::vector2df& getTCoords(u32 i) |
188 | { | 188 | { |
189 | return getVertexBuffer()[i].TCoords; | 189 | return getVertexBuffer()[i].TCoords; |
190 | } | 190 | } |
191 | 191 | ||
192 | //! returns normal of vertex i | 192 | //! returns normal of vertex i |
193 | virtual const core::vector3df& getNormal(u32 i) const | 193 | virtual const core::vector3df& getNormal(u32 i) const |
194 | { | 194 | { |
195 | return getVertexBuffer()[i].Normal; | 195 | return getVertexBuffer()[i].Normal; |
196 | } | 196 | } |
197 | 197 | ||
198 | //! returns normal of vertex i | 198 | //! returns normal of vertex i |
199 | virtual core::vector3df& getNormal(u32 i) | 199 | virtual core::vector3df& getNormal(u32 i) |
200 | { | 200 | { |
201 | return getVertexBuffer()[i].Normal; | 201 | return getVertexBuffer()[i].Normal; |
202 | } | 202 | } |
203 | }; | 203 | }; |
204 | 204 | ||
205 | 205 | ||
206 | } // end namespace scene | 206 | } // end namespace scene |
207 | } // end namespace irr | 207 | } // end namespace irr |
208 | 208 | ||
209 | #endif | 209 | #endif |
210 | 210 | ||
211 | 211 | ||