aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/include/IMeshBuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/irrlicht-1.8/include/IMeshBuffer.h')
-rw-r--r--libraries/irrlicht-1.8/include/IMeshBuffer.h308
1 files changed, 154 insertions, 154 deletions
diff --git a/libraries/irrlicht-1.8/include/IMeshBuffer.h b/libraries/irrlicht-1.8/include/IMeshBuffer.h
index 44b865b..99a9f48 100644
--- a/libraries/irrlicht-1.8/include/IMeshBuffer.h
+++ b/libraries/irrlicht-1.8/include/IMeshBuffer.h
@@ -1,154 +1,154 @@
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#ifndef __I_MESH_BUFFER_H_INCLUDED__ 5#ifndef __I_MESH_BUFFER_H_INCLUDED__
6#define __I_MESH_BUFFER_H_INCLUDED__ 6#define __I_MESH_BUFFER_H_INCLUDED__
7 7
8#include "IReferenceCounted.h" 8#include "IReferenceCounted.h"
9#include "SMaterial.h" 9#include "SMaterial.h"
10#include "aabbox3d.h" 10#include "aabbox3d.h"
11#include "S3DVertex.h" 11#include "S3DVertex.h"
12#include "SVertexIndex.h" 12#include "SVertexIndex.h"
13#include "EHardwareBufferFlags.h" 13#include "EHardwareBufferFlags.h"
14#include "EPrimitiveTypes.h" 14#include "EPrimitiveTypes.h"
15 15
16namespace irr 16namespace irr
17{ 17{
18namespace scene 18namespace scene
19{ 19{
20 //! Struct for holding a mesh with a single material. 20 //! Struct for holding a mesh with a single material.
21 /** A part of an IMesh which has the same material on each face of that 21 /** A part of an IMesh which has the same material on each face of that
22 group. Logical groups of an IMesh need not be put into separate mesh 22 group. Logical groups of an IMesh need not be put into separate mesh
23 buffers, but can be. Separately animated parts of the mesh must be put 23 buffers, but can be. Separately animated parts of the mesh must be put
24 into separate mesh buffers. 24 into separate mesh buffers.
25 Some mesh buffer implementations have limitations on the number of 25 Some mesh buffer implementations have limitations on the number of
26 vertices the buffer can hold. In that case, logical grouping can help. 26 vertices the buffer can hold. In that case, logical grouping can help.
27 Moreover, the number of vertices should be optimized for the GPU upload, 27 Moreover, the number of vertices should be optimized for the GPU upload,
28 which often depends on the type of gfx card. Typial figures are 28 which often depends on the type of gfx card. Typial figures are
29 1000-10000 vertices per buffer. 29 1000-10000 vertices per buffer.
30 SMeshBuffer is a simple implementation of a MeshBuffer, which supports 30 SMeshBuffer is a simple implementation of a MeshBuffer, which supports
31 up to 65535 vertices. 31 up to 65535 vertices.
32 32
33 Since meshbuffers are used for drawing, and hence will be exposed 33 Since meshbuffers are used for drawing, and hence will be exposed
34 to the driver, chances are high that they are grab()'ed from somewhere. 34 to the driver, chances are high that they are grab()'ed from somewhere.
35 It's therefore required to dynamically allocate meshbuffers which are 35 It's therefore required to dynamically allocate meshbuffers which are
36 passed to a video driver and only drop the buffer once it's not used in 36 passed to a video driver and only drop the buffer once it's not used in
37 the current code block anymore. 37 the current code block anymore.
38 */ 38 */
39 class IMeshBuffer : public virtual IReferenceCounted 39 class IMeshBuffer : public virtual IReferenceCounted
40 { 40 {
41 public: 41 public:
42 42
43 //! Get the material of this meshbuffer 43 //! Get the material of this meshbuffer
44 /** \return Material of this buffer. */ 44 /** \return Material of this buffer. */
45 virtual video::SMaterial& getMaterial() = 0; 45 virtual video::SMaterial& getMaterial() = 0;
46 46
47 //! Get the material of this meshbuffer 47 //! Get the material of this meshbuffer
48 /** \return Material of this buffer. */ 48 /** \return Material of this buffer. */
49 virtual const video::SMaterial& getMaterial() const = 0; 49 virtual const video::SMaterial& getMaterial() const = 0;
50 50
51 //! Get type of vertex data which is stored in this meshbuffer. 51 //! Get type of vertex data which is stored in this meshbuffer.
52 /** \return Vertex type of this buffer. */ 52 /** \return Vertex type of this buffer. */
53 virtual video::E_VERTEX_TYPE getVertexType() const = 0; 53 virtual video::E_VERTEX_TYPE getVertexType() const = 0;
54 54
55 //! Get access to vertex data. The data is an array of vertices. 55 //! Get access to vertex data. The data is an array of vertices.
56 /** Which vertex type is used can be determined by getVertexType(). 56 /** Which vertex type is used can be determined by getVertexType().
57 \return Pointer to array of vertices. */ 57 \return Pointer to array of vertices. */
58 virtual const void* getVertices() const = 0; 58 virtual const void* getVertices() const = 0;
59 59
60 //! Get access to vertex data. The data is an array of vertices. 60 //! Get access to vertex data. The data is an array of vertices.
61 /** Which vertex type is used can be determined by getVertexType(). 61 /** Which vertex type is used can be determined by getVertexType().
62 \return Pointer to array of vertices. */ 62 \return Pointer to array of vertices. */
63 virtual void* getVertices() = 0; 63 virtual void* getVertices() = 0;
64 64
65 //! Get amount of vertices in meshbuffer. 65 //! Get amount of vertices in meshbuffer.
66 /** \return Number of vertices in this buffer. */ 66 /** \return Number of vertices in this buffer. */
67 virtual u32 getVertexCount() const = 0; 67 virtual u32 getVertexCount() const = 0;
68 68
69 //! Get type of index data which is stored in this meshbuffer. 69 //! Get type of index data which is stored in this meshbuffer.
70 /** \return Index type of this buffer. */ 70 /** \return Index type of this buffer. */
71 virtual video::E_INDEX_TYPE getIndexType() const =0; 71 virtual video::E_INDEX_TYPE getIndexType() const =0;
72 72
73 //! Get access to Indices. 73 //! Get access to Indices.
74 /** \return Pointer to indices array. */ 74 /** \return Pointer to indices array. */
75 virtual const u16* getIndices() const = 0; 75 virtual const u16* getIndices() const = 0;
76 76
77 //! Get access to Indices. 77 //! Get access to Indices.
78 /** \return Pointer to indices array. */ 78 /** \return Pointer to indices array. */
79 virtual u16* getIndices() = 0; 79 virtual u16* getIndices() = 0;
80 80
81 //! Get amount of indices in this meshbuffer. 81 //! Get amount of indices in this meshbuffer.
82 /** \return Number of indices in this buffer. */ 82 /** \return Number of indices in this buffer. */
83 virtual u32 getIndexCount() const = 0; 83 virtual u32 getIndexCount() const = 0;
84 84
85 //! Get the axis aligned bounding box of this meshbuffer. 85 //! Get the axis aligned bounding box of this meshbuffer.
86 /** \return Axis aligned bounding box of this buffer. */ 86 /** \return Axis aligned bounding box of this buffer. */
87 virtual const core::aabbox3df& getBoundingBox() const = 0; 87 virtual const core::aabbox3df& getBoundingBox() const = 0;
88 88
89 //! Set axis aligned bounding box 89 //! Set axis aligned bounding box
90 /** \param box User defined axis aligned bounding box to use 90 /** \param box User defined axis aligned bounding box to use
91 for this buffer. */ 91 for this buffer. */
92 virtual void setBoundingBox(const core::aabbox3df& box) = 0; 92 virtual void setBoundingBox(const core::aabbox3df& box) = 0;
93 93
94 //! Recalculates the bounding box. Should be called if the mesh changed. 94 //! Recalculates the bounding box. Should be called if the mesh changed.
95 virtual void recalculateBoundingBox() = 0; 95 virtual void recalculateBoundingBox() = 0;
96 96
97 //! returns position of vertex i 97 //! returns position of vertex i
98 virtual const core::vector3df& getPosition(u32 i) const = 0; 98 virtual const core::vector3df& getPosition(u32 i) const = 0;
99 99
100 //! returns position of vertex i 100 //! returns position of vertex i
101 virtual core::vector3df& getPosition(u32 i) = 0; 101 virtual core::vector3df& getPosition(u32 i) = 0;
102 102
103 //! returns normal of vertex i 103 //! returns normal of vertex i
104 virtual const core::vector3df& getNormal(u32 i) const = 0; 104 virtual const core::vector3df& getNormal(u32 i) const = 0;
105 105
106 //! returns normal of vertex i 106 //! returns normal of vertex i
107 virtual core::vector3df& getNormal(u32 i) = 0; 107 virtual core::vector3df& getNormal(u32 i) = 0;
108 108
109 //! returns texture coord of vertex i 109 //! returns texture coord of vertex i
110 virtual const core::vector2df& getTCoords(u32 i) const = 0; 110 virtual const core::vector2df& getTCoords(u32 i) const = 0;
111 111
112 //! returns texture coord of vertex i 112 //! returns texture coord of vertex i
113 virtual core::vector2df& getTCoords(u32 i) = 0; 113 virtual core::vector2df& getTCoords(u32 i) = 0;
114 114
115 //! Append the vertices and indices to the current buffer 115 //! Append the vertices and indices to the current buffer
116 /** Only works for compatible vertex types. 116 /** Only works for compatible vertex types.
117 \param vertices Pointer to a vertex array. 117 \param vertices Pointer to a vertex array.
118 \param numVertices Number of vertices in the array. 118 \param numVertices Number of vertices in the array.
119 \param indices Pointer to index array. 119 \param indices Pointer to index array.
120 \param numIndices Number of indices in array. */ 120 \param numIndices Number of indices in array. */
121 virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) = 0; 121 virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) = 0;
122 122
123 //! Append the meshbuffer to the current buffer 123 //! Append the meshbuffer to the current buffer
124 /** Only works for compatible vertex types 124 /** Only works for compatible vertex types
125 \param other Buffer to append to this one. */ 125 \param other Buffer to append to this one. */
126 virtual void append(const IMeshBuffer* const other) = 0; 126 virtual void append(const IMeshBuffer* const other) = 0;
127 127
128 //! get the current hardware mapping hint 128 //! get the current hardware mapping hint
129 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const = 0; 129 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const = 0;
130 130
131 //! get the current hardware mapping hint 131 //! get the current hardware mapping hint
132 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const = 0; 132 virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const = 0;
133 133
134 //! set the hardware mapping hint, for driver 134 //! set the hardware mapping hint, for driver
135 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX ) = 0; 135 virtual void setHardwareMappingHint( E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX ) = 0;
136 136
137 //! flags the meshbuffer as changed, reloads hardware buffers 137 //! flags the meshbuffer as changed, reloads hardware buffers
138 virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) = 0; 138 virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) = 0;
139 139
140 //! Get the currently used ID for identification of changes. 140 //! Get the currently used ID for identification of changes.
141 /** This shouldn't be used for anything outside the VideoDriver. */ 141 /** This shouldn't be used for anything outside the VideoDriver. */
142 virtual u32 getChangedID_Vertex() const = 0; 142 virtual u32 getChangedID_Vertex() const = 0;
143 143
144 //! Get the currently used ID for identification of changes. 144 //! Get the currently used ID for identification of changes.
145 /** This shouldn't be used for anything outside the VideoDriver. */ 145 /** This shouldn't be used for anything outside the VideoDriver. */
146 virtual u32 getChangedID_Index() const = 0; 146 virtual u32 getChangedID_Index() const = 0;
147 }; 147 };
148 148
149} // end namespace scene 149} // end namespace scene
150} // end namespace irr 150} // end namespace irr
151 151
152#endif 152#endif
153 153
154 154