arsa  2.7
Public Member Functions | Public Attributes | List of all members
irr::scene::SSharedMeshBuffer Struct Reference

Implementation of the IMeshBuffer interface with shared vertex list. More...

#include <SSharedMeshBuffer.h>

Inheritance diagram for irr::scene::SSharedMeshBuffer:
irr::scene::IMeshBuffer irr::IReferenceCounted

Public Member Functions

 SSharedMeshBuffer ()
 constructor More...
 
 SSharedMeshBuffer (core::array< video::S3DVertex > *vertices)
 constructor More...
 
virtual const video::SMaterialgetMaterial () const _IRR_OVERRIDE_
 returns the material of this meshbuffer More...
 
virtual video::SMaterialgetMaterial () _IRR_OVERRIDE_
 returns the material of this meshbuffer More...
 
virtual const voidgetVertices () const _IRR_OVERRIDE_
 returns pointer to vertices More...
 
virtual voidgetVertices () _IRR_OVERRIDE_
 returns pointer to vertices More...
 
virtual u32 getVertexCount () const _IRR_OVERRIDE_
 returns amount of vertices More...
 
virtual const u16getIndices () const _IRR_OVERRIDE_
 returns pointer to indices More...
 
virtual u16getIndices () _IRR_OVERRIDE_
 returns pointer to indices More...
 
virtual u32 getIndexCount () const _IRR_OVERRIDE_
 returns amount of indices More...
 
virtual video::E_INDEX_TYPE getIndexType () const _IRR_OVERRIDE_
 Get type of index data which is stored in this meshbuffer. More...
 
virtual const core::aabbox3d< f32 > & getBoundingBox () const _IRR_OVERRIDE_
 returns an axis aligned bounding box More...
 
virtual void setBoundingBox (const core::aabbox3df &box) _IRR_OVERRIDE_
 set user axis aligned bounding box More...
 
virtual video::E_VERTEX_TYPE getVertexType () const _IRR_OVERRIDE_
 returns which type of vertex data is stored. More...
 
virtual void recalculateBoundingBox () _IRR_OVERRIDE_
 recalculates the bounding box. should be called if the mesh changed. More...
 
virtual const core::vector3dfgetPosition (u32 i) const _IRR_OVERRIDE_
 returns position of vertex i More...
 
virtual core::vector3dfgetPosition (u32 i) _IRR_OVERRIDE_
 returns position of vertex i More...
 
virtual const core::vector3dfgetNormal (u32 i) const _IRR_OVERRIDE_
 returns normal of vertex i More...
 
virtual core::vector3dfgetNormal (u32 i) _IRR_OVERRIDE_
 returns normal of vertex i More...
 
virtual const core::vector2dfgetTCoords (u32 i) const _IRR_OVERRIDE_
 returns texture coord of vertex i More...
 
virtual core::vector2dfgetTCoords (u32 i) _IRR_OVERRIDE_
 returns texture coord of vertex i More...
 
virtual void append (const void *const vertices, u32 numVertices, const u16 *const indices, u32 numIndices) _IRR_OVERRIDE_
 append the vertices and indices to the current buffer More...
 
virtual void append (const IMeshBuffer *const other) _IRR_OVERRIDE_
 append the meshbuffer to the current buffer More...
 
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex () const _IRR_OVERRIDE_
 get the current hardware mapping hint More...
 
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index () const _IRR_OVERRIDE_
 get the current hardware mapping hint More...
 
virtual void setHardwareMappingHint (E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_
 set the hardware mapping hint, for driver More...
 
virtual void setPrimitiveType (E_PRIMITIVE_TYPE type) _IRR_OVERRIDE_
 Describe what kind of primitive geometry is used by the meshbuffer. More...
 
virtual E_PRIMITIVE_TYPE getPrimitiveType () const _IRR_OVERRIDE_
 Get the kind of primitive geometry which is used by the meshbuffer. More...
 
virtual void setDirty (E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX) _IRR_OVERRIDE_
 flags the mesh as changed, reloads hardware buffers More...
 
virtual u32 getChangedID_Vertex () const _IRR_OVERRIDE_
 Get the currently used ID for identification of changes. More...
 
virtual u32 getChangedID_Index () const _IRR_OVERRIDE_
 Get the currently used ID for identification of changes. More...
 
- Public Member Functions inherited from irr::scene::IMeshBuffer
virtual u32 getPrimitiveCount () const
 Calculate how many geometric primitives are used by this meshbuffer. More...
 
- Public Member Functions inherited from irr::IReferenceCounted
 IReferenceCounted ()
 Constructor. More...
 
virtual ~IReferenceCounted ()
 Destructor. More...
 
void grab () const
 Grabs the object. Increments the reference counter by one. More...
 
bool drop () const
 Drops the object. Decrements the reference counter by one. More...
 
s32 getReferenceCount () const
 Get the reference count. More...
 
const c8getDebugName () const
 Returns the debug name of the object. More...
 

Public Attributes

video::SMaterial Material
 Material of this meshBuffer. More...
 
core::array< video::S3DVertex > * Vertices
 Shared Array of vertices. More...
 
core::array< u16Indices
 Array of indices. More...
 
u32 ChangedID_Vertex
 ID used for hardware buffer management. More...
 
u32 ChangedID_Index
 ID used for hardware buffer management. More...
 
core::aabbox3df BoundingBox
 Bounding box. More...
 
E_HARDWARE_MAPPING MappingHintVertex
 hardware mapping hint More...
 
E_HARDWARE_MAPPING MappingHintIndex
 
E_PRIMITIVE_TYPE PrimitiveType
 Primitive type used for rendering (triangles, lines, ...) More...
 

Additional Inherited Members

- Protected Member Functions inherited from irr::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object. More...
 

Detailed Description

Implementation of the IMeshBuffer interface with shared vertex list.

Definition at line 16 of file SSharedMeshBuffer.h.

Constructor & Destructor Documentation

◆ SSharedMeshBuffer() [1/2]

irr::scene::SSharedMeshBuffer::SSharedMeshBuffer ( )
inline

constructor

Definition at line 19 of file SSharedMeshBuffer.h.

20  : IMeshBuffer()
24  {
25  #ifdef _DEBUG
26  setDebugName("SSharedMeshBuffer");
27  #endif
28  }
core::array< video::S3DVertex > * Vertices
Shared Array of vertices.
Don't store on the hardware.
Explicitly set all vertices for each triangle.
E_PRIMITIVE_TYPE PrimitiveType
Primitive type used for rendering (triangles, lines, ...)
void setDebugName(const c8 *newName)
Sets the debug name of the object.
u32 ChangedID_Index
ID used for hardware buffer management.
E_HARDWARE_MAPPING MappingHintVertex
hardware mapping hint
u32 ChangedID_Vertex
ID used for hardware buffer management.
E_HARDWARE_MAPPING MappingHintIndex

◆ SSharedMeshBuffer() [2/2]

irr::scene::SSharedMeshBuffer::SSharedMeshBuffer ( core::array< video::S3DVertex > *  vertices)
inline

constructor

Definition at line 31 of file SSharedMeshBuffer.h.

32  {
33  #ifdef _DEBUG
34  setDebugName("SSharedMeshBuffer");
35  #endif
36  }
core::array< video::S3DVertex > * Vertices
Shared Array of vertices.
Don't store on the hardware.
void setDebugName(const c8 *newName)
Sets the debug name of the object.
u32 ChangedID_Index
ID used for hardware buffer management.
E_HARDWARE_MAPPING MappingHintVertex
hardware mapping hint
u32 ChangedID_Vertex
ID used for hardware buffer management.
E_HARDWARE_MAPPING MappingHintIndex

Member Function Documentation

◆ append() [1/2]

virtual void irr::scene::SSharedMeshBuffer::append ( const void *const  vertices,
u32  numVertices,
const u16 *const  indices,
u32  numIndices 
)
inlinevirtual

append the vertices and indices to the current buffer

Implements irr::scene::IMeshBuffer.

Definition at line 175 of file SSharedMeshBuffer.h.

175 {}

◆ append() [2/2]

virtual void irr::scene::SSharedMeshBuffer::append ( const IMeshBuffer *const  other)
inlinevirtual

append the meshbuffer to the current buffer

Implements irr::scene::IMeshBuffer.

Definition at line 177 of file SSharedMeshBuffer.h.

177 {}

◆ getBoundingBox()

virtual const core::aabbox3d<f32>& irr::scene::SSharedMeshBuffer::getBoundingBox ( ) const
inlinevirtual

returns an axis aligned bounding box

Implements irr::scene::IMeshBuffer.

Definition at line 102 of file SSharedMeshBuffer.h.

103  {
104  return BoundingBox;
105  }
core::aabbox3df BoundingBox
Bounding box.

◆ getChangedID_Index()

virtual u32 irr::scene::SSharedMeshBuffer::getChangedID_Index ( ) const
inlinevirtual

Get the currently used ID for identification of changes.

This shouldn't be used for anything outside the VideoDriver.

Implements irr::scene::IMeshBuffer.

Definition at line 227 of file SSharedMeshBuffer.h.

227 {return ChangedID_Index;}
u32 ChangedID_Index
ID used for hardware buffer management.

◆ getChangedID_Vertex()

virtual u32 irr::scene::SSharedMeshBuffer::getChangedID_Vertex ( ) const
inlinevirtual

Get the currently used ID for identification of changes.

This shouldn't be used for anything outside the VideoDriver.

Implements irr::scene::IMeshBuffer.

Definition at line 223 of file SSharedMeshBuffer.h.

223 {return ChangedID_Vertex;}
u32 ChangedID_Vertex
ID used for hardware buffer management.

◆ getHardwareMappingHint_Index()

virtual E_HARDWARE_MAPPING irr::scene::SSharedMeshBuffer::getHardwareMappingHint_Index ( ) const
inlinevirtual

get the current hardware mapping hint

Implements irr::scene::IMeshBuffer.

Definition at line 186 of file SSharedMeshBuffer.h.

187  {
188  return MappingHintIndex;
189  }
E_HARDWARE_MAPPING MappingHintIndex

◆ getHardwareMappingHint_Vertex()

virtual E_HARDWARE_MAPPING irr::scene::SSharedMeshBuffer::getHardwareMappingHint_Vertex ( ) const
inlinevirtual

get the current hardware mapping hint

Implements irr::scene::IMeshBuffer.

Definition at line 180 of file SSharedMeshBuffer.h.

181  {
182  return MappingHintVertex;
183  }
E_HARDWARE_MAPPING MappingHintVertex
hardware mapping hint

◆ getIndexCount()

virtual u32 irr::scene::SSharedMeshBuffer::getIndexCount ( ) const
inlinevirtual

returns amount of indices

Implements irr::scene::IMeshBuffer.

Definition at line 90 of file SSharedMeshBuffer.h.

91  {
92  return Indices.size();
93  }
core::array< u16 > Indices
Array of indices.
u32 size() const
Get number of occupied elements of the array.
Definition: irrArray.h:364

◆ getIndexType()

virtual video::E_INDEX_TYPE irr::scene::SSharedMeshBuffer::getIndexType ( ) const
inlinevirtual

Get type of index data which is stored in this meshbuffer.

Implements irr::scene::IMeshBuffer.

Definition at line 96 of file SSharedMeshBuffer.h.

97  {
98  return video::EIT_16BIT;
99  }

◆ getIndices() [1/2]

virtual const u16* irr::scene::SSharedMeshBuffer::getIndices ( ) const
inlinevirtual

returns pointer to indices

Implements irr::scene::IMeshBuffer.

Definition at line 78 of file SSharedMeshBuffer.h.

79  {
80  return Indices.const_pointer();
81  }
const T * const_pointer() const
Gets a const pointer to the array.
Definition: irrArray.h:356
core::array< u16 > Indices
Array of indices.

◆ getIndices() [2/2]

virtual u16* irr::scene::SSharedMeshBuffer::getIndices ( )
inlinevirtual

returns pointer to indices

Implements irr::scene::IMeshBuffer.

Definition at line 84 of file SSharedMeshBuffer.h.

85  {
86  return Indices.pointer();
87  }
core::array< u16 > Indices
Array of indices.
T * pointer()
Gets a pointer to the array.
Definition: irrArray.h:348

◆ getMaterial() [1/2]

virtual const video::SMaterial& irr::scene::SSharedMeshBuffer::getMaterial ( ) const
inlinevirtual

returns the material of this meshbuffer

Implements irr::scene::IMeshBuffer.

Definition at line 39 of file SSharedMeshBuffer.h.

40  {
41  return Material;
42  }
video::SMaterial Material
Material of this meshBuffer.

◆ getMaterial() [2/2]

virtual video::SMaterial& irr::scene::SSharedMeshBuffer::getMaterial ( )
inlinevirtual

returns the material of this meshbuffer

Implements irr::scene::IMeshBuffer.

Definition at line 45 of file SSharedMeshBuffer.h.

46  {
47  return Material;
48  }
video::SMaterial Material
Material of this meshBuffer.

◆ getNormal() [1/2]

virtual const core::vector3df& irr::scene::SSharedMeshBuffer::getNormal ( u32  i) const
inlinevirtual

returns normal of vertex i

Implements irr::scene::IMeshBuffer.

Definition at line 147 of file SSharedMeshBuffer.h.

148  {
150  return (*Vertices)[Indices[i]].Normal;
151  }
core::array< video::S3DVertex > * Vertices
Shared Array of vertices.
core::array< u16 > Indices
Array of indices.
#define _IRR_DEBUG_BREAK_IF(_CONDITION_)
define a break macro for debugging.
Definition: irrTypes.h:185

◆ getNormal() [2/2]

virtual core::vector3df& irr::scene::SSharedMeshBuffer::getNormal ( u32  i)
inlinevirtual

returns normal of vertex i

Implements irr::scene::IMeshBuffer.

Definition at line 154 of file SSharedMeshBuffer.h.

155  {
157  return (*Vertices)[Indices[i]].Normal;
158  }
core::array< video::S3DVertex > * Vertices
Shared Array of vertices.
core::array< u16 > Indices
Array of indices.
#define _IRR_DEBUG_BREAK_IF(_CONDITION_)
define a break macro for debugging.
Definition: irrTypes.h:185

◆ getPosition() [1/2]

virtual const core::vector3df& irr::scene::SSharedMeshBuffer::getPosition ( u32  i) const
inlinevirtual

returns position of vertex i

Implements irr::scene::IMeshBuffer.

Definition at line 133 of file SSharedMeshBuffer.h.

134  {
136  return (*Vertices)[Indices[i]].Pos;
137  }
core::array< video::S3DVertex > * Vertices
Shared Array of vertices.
core::array< u16 > Indices
Array of indices.
#define _IRR_DEBUG_BREAK_IF(_CONDITION_)
define a break macro for debugging.
Definition: irrTypes.h:185

◆ getPosition() [2/2]

virtual core::vector3df& irr::scene::SSharedMeshBuffer::getPosition ( u32  i)
inlinevirtual

returns position of vertex i

Implements irr::scene::IMeshBuffer.

Definition at line 140 of file SSharedMeshBuffer.h.

141  {
143  return (*Vertices)[Indices[i]].Pos;
144  }
core::array< video::S3DVertex > * Vertices
Shared Array of vertices.
core::array< u16 > Indices
Array of indices.
#define _IRR_DEBUG_BREAK_IF(_CONDITION_)
define a break macro for debugging.
Definition: irrTypes.h:185

◆ getPrimitiveType()

virtual E_PRIMITIVE_TYPE irr::scene::SSharedMeshBuffer::getPrimitiveType ( ) const
inlinevirtual

Get the kind of primitive geometry which is used by the meshbuffer.

Implements irr::scene::IMeshBuffer.

Definition at line 207 of file SSharedMeshBuffer.h.

208  {
209  return PrimitiveType;
210  }
E_PRIMITIVE_TYPE PrimitiveType
Primitive type used for rendering (triangles, lines, ...)

◆ getTCoords() [1/2]

virtual const core::vector2df& irr::scene::SSharedMeshBuffer::getTCoords ( u32  i) const
inlinevirtual

returns texture coord of vertex i

Implements irr::scene::IMeshBuffer.

Definition at line 161 of file SSharedMeshBuffer.h.

162  {
164  return (*Vertices)[Indices[i]].TCoords;
165  }
core::array< video::S3DVertex > * Vertices
Shared Array of vertices.
core::array< u16 > Indices
Array of indices.
#define _IRR_DEBUG_BREAK_IF(_CONDITION_)
define a break macro for debugging.
Definition: irrTypes.h:185

◆ getTCoords() [2/2]

virtual core::vector2df& irr::scene::SSharedMeshBuffer::getTCoords ( u32  i)
inlinevirtual

returns texture coord of vertex i

Implements irr::scene::IMeshBuffer.

Definition at line 168 of file SSharedMeshBuffer.h.

169  {
171  return (*Vertices)[Indices[i]].TCoords;
172  }
core::array< video::S3DVertex > * Vertices
Shared Array of vertices.
core::array< u16 > Indices
Array of indices.
#define _IRR_DEBUG_BREAK_IF(_CONDITION_)
define a break macro for debugging.
Definition: irrTypes.h:185

◆ getVertexCount()

virtual u32 irr::scene::SSharedMeshBuffer::getVertexCount ( ) const
inlinevirtual

returns amount of vertices

Implements irr::scene::IMeshBuffer.

Definition at line 69 of file SSharedMeshBuffer.h.

70  {
71  if (Vertices)
72  return Vertices->size();
73  else
74  return 0;
75  }
core::array< video::S3DVertex > * Vertices
Shared Array of vertices.

◆ getVertexType()

virtual video::E_VERTEX_TYPE irr::scene::SSharedMeshBuffer::getVertexType ( ) const
inlinevirtual

returns which type of vertex data is stored.

Implements irr::scene::IMeshBuffer.

Definition at line 114 of file SSharedMeshBuffer.h.

115  {
116  return video::EVT_STANDARD;
117  }
Standard vertex type used by the Irrlicht engine, video::S3DVertex.
Definition: S3DVertex.h:21

◆ getVertices() [1/2]

virtual const void* irr::scene::SSharedMeshBuffer::getVertices ( ) const
inlinevirtual

returns pointer to vertices

Implements irr::scene::IMeshBuffer.

Definition at line 51 of file SSharedMeshBuffer.h.

52  {
53  if (Vertices)
54  return Vertices->const_pointer();
55  else
56  return 0;
57  }
core::array< video::S3DVertex > * Vertices
Shared Array of vertices.

◆ getVertices() [2/2]

virtual void* irr::scene::SSharedMeshBuffer::getVertices ( )
inlinevirtual

returns pointer to vertices

Implements irr::scene::IMeshBuffer.

Definition at line 60 of file SSharedMeshBuffer.h.

61  {
62  if (Vertices)
63  return Vertices->pointer();
64  else
65  return 0;
66  }
core::array< video::S3DVertex > * Vertices
Shared Array of vertices.

◆ recalculateBoundingBox()

virtual void irr::scene::SSharedMeshBuffer::recalculateBoundingBox ( )
inlinevirtual

recalculates the bounding box. should be called if the mesh changed.

Implements irr::scene::IMeshBuffer.

Definition at line 120 of file SSharedMeshBuffer.h.

121  {
122  if (!Vertices || Vertices->empty() || Indices.empty())
123  BoundingBox.reset(0,0,0);
124  else
125  {
126  BoundingBox.reset((*Vertices)[Indices[0]].Pos);
127  for (u32 i=1; i<Indices.size(); ++i)
129  }
130  }
core::array< video::S3DVertex > * Vertices
Shared Array of vertices.
core::array< u16 > Indices
Array of indices.
void reset(T x, T y, T z)
Resets the bounding box to a one-point box.
Definition: aabbox3d.h:50
bool empty() const
Check if array is empty.
Definition: irrArray.h:381
core::aabbox3df BoundingBox
Bounding box.
unsigned int u32
32 bit unsigned variable.
Definition: irrTypes.h:62
u32 size() const
Get number of occupied elements of the array.
Definition: irrArray.h:364
void addInternalPoint(const vector3d< T > &p)
Adds a point to the bounding box.
Definition: aabbox3d.h:74

◆ setBoundingBox()

virtual void irr::scene::SSharedMeshBuffer::setBoundingBox ( const core::aabbox3df box)
inlinevirtual

set user axis aligned bounding box

Implements irr::scene::IMeshBuffer.

Definition at line 108 of file SSharedMeshBuffer.h.

109  {
110  BoundingBox = box;
111  }
core::aabbox3df BoundingBox
Bounding box.

◆ setDirty()

virtual void irr::scene::SSharedMeshBuffer::setDirty ( E_BUFFER_TYPE  buffer = EBT_VERTEX_AND_INDEX)
inlinevirtual

flags the mesh as changed, reloads hardware buffers

Implements irr::scene::IMeshBuffer.

Definition at line 213 of file SSharedMeshBuffer.h.

214  {
218  ++ChangedID_Index;
219  }
Change the vertex mapping.
Change both vertex and index mapping to the same value.
Change the index mapping.
GLuint buffer
u32 ChangedID_Index
ID used for hardware buffer management.
u32 ChangedID_Vertex
ID used for hardware buffer management.

◆ setHardwareMappingHint()

virtual void irr::scene::SSharedMeshBuffer::setHardwareMappingHint ( E_HARDWARE_MAPPING  NewMappingHint,
E_BUFFER_TYPE  buffer = EBT_VERTEX_AND_INDEX 
)
inlinevirtual

set the hardware mapping hint, for driver

Implements irr::scene::IMeshBuffer.

Definition at line 192 of file SSharedMeshBuffer.h.

193  {
195  MappingHintVertex=NewMappingHint;
197  MappingHintIndex=NewMappingHint;
198  }
Change the vertex mapping.
Change both vertex and index mapping to the same value.
Change the index mapping.
GLuint buffer
E_HARDWARE_MAPPING MappingHintVertex
hardware mapping hint
E_HARDWARE_MAPPING MappingHintIndex

◆ setPrimitiveType()

virtual void irr::scene::SSharedMeshBuffer::setPrimitiveType ( E_PRIMITIVE_TYPE  type)
inlinevirtual

Describe what kind of primitive geometry is used by the meshbuffer.

Implements irr::scene::IMeshBuffer.

Definition at line 201 of file SSharedMeshBuffer.h.

202  {
204  }
E_PRIMITIVE_TYPE PrimitiveType
Primitive type used for rendering (triangles, lines, ...)
GLuint GLuint GLsizei GLenum type
Definition: SDL_opengl.h:1571

Member Data Documentation

◆ BoundingBox

core::aabbox3df irr::scene::SSharedMeshBuffer::BoundingBox

Bounding box.

Definition at line 245 of file SSharedMeshBuffer.h.

◆ ChangedID_Index

u32 irr::scene::SSharedMeshBuffer::ChangedID_Index

ID used for hardware buffer management.

Definition at line 242 of file SSharedMeshBuffer.h.

◆ ChangedID_Vertex

u32 irr::scene::SSharedMeshBuffer::ChangedID_Vertex

ID used for hardware buffer management.

Definition at line 239 of file SSharedMeshBuffer.h.

◆ Indices

core::array<u16> irr::scene::SSharedMeshBuffer::Indices

Array of indices.

Definition at line 236 of file SSharedMeshBuffer.h.

◆ MappingHintIndex

E_HARDWARE_MAPPING irr::scene::SSharedMeshBuffer::MappingHintIndex

Definition at line 249 of file SSharedMeshBuffer.h.

◆ MappingHintVertex

E_HARDWARE_MAPPING irr::scene::SSharedMeshBuffer::MappingHintVertex

hardware mapping hint

Definition at line 248 of file SSharedMeshBuffer.h.

◆ Material

video::SMaterial irr::scene::SSharedMeshBuffer::Material

Material of this meshBuffer.

Definition at line 230 of file SSharedMeshBuffer.h.

◆ PrimitiveType

E_PRIMITIVE_TYPE irr::scene::SSharedMeshBuffer::PrimitiveType

Primitive type used for rendering (triangles, lines, ...)

Definition at line 252 of file SSharedMeshBuffer.h.

◆ Vertices

core::array<video::S3DVertex>* irr::scene::SSharedMeshBuffer::Vertices

Shared Array of vertices.

Definition at line 233 of file SSharedMeshBuffer.h.


The documentation for this struct was generated from the following file: