Loading...
Searching...
No Matches
IDynamicMeshBuffer.h
Go to the documentation of this file.
// Copyright (C) 2008-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_DYNAMIC_MESH_BUFFER_H_INCLUDED__
#define __I_DYNAMIC_MESH_BUFFER_H_INCLUDED__
#include "IMeshBuffer.h"
#include "IVertexBuffer.h"
#include "IIndexBuffer.h"
namespace irr
{
namespace scene
{
class IDynamicMeshBuffer : public IMeshBuffer
{
public:
virtual IVertexBuffer &getVertexBuffer() const =0;
virtual IIndexBuffer &getIndexBuffer() const =0;
virtual void setVertexBuffer(IVertexBuffer *vertexBuffer) =0;
virtual void setIndexBuffer(IIndexBuffer *indexBuffer) =0;
virtual video::SMaterial& getMaterial() =0;
virtual const video::SMaterial& getMaterial() const =0;
virtual const core::aabbox3df& getBoundingBox() const =0;
virtual void setBoundingBox(const core::aabbox3df& box) =0;
virtual void recalculateBoundingBox() =0;
virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices)
{
}
virtual void append(const IMeshBuffer* const other)
{
}
// ------------------- To be removed? ------------------- //
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const
{
return getVertexBuffer().getHardwareMappingHint();
}
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const
{
return getIndexBuffer().getHardwareMappingHint();
}
virtual void setHardwareMappingHint( E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX )
{
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX)
getVertexBuffer().setHardwareMappingHint(NewMappingHint);
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX)
getIndexBuffer().setHardwareMappingHint(NewMappingHint);
}
virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX)
{
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_VERTEX)
getVertexBuffer().setDirty();
if (Buffer==EBT_VERTEX_AND_INDEX || Buffer==EBT_INDEX)
getIndexBuffer().setDirty();
}
virtual u32 getChangedID_Vertex() const
{
return getVertexBuffer().getChangedID();
}
virtual u32 getChangedID_Index() const
{
return getIndexBuffer().getChangedID();
}
// ------------------- Old interface ------------------- //
virtual video::E_VERTEX_TYPE getVertexType() const
{
return getVertexBuffer().getType();
}
virtual const void* getVertices() const
{
return getVertexBuffer().getData();
}
virtual void* getVertices()
{
return getVertexBuffer().getData();
}
virtual u32 getVertexCount() const
{
return getVertexBuffer().size();
}
virtual video::E_INDEX_TYPE getIndexType() const
{
return getIndexBuffer().getType();
}
virtual const u16* getIndices() const
{
return (u16*)getIndexBuffer().getData();
}
virtual u16* getIndices()
{
return (u16*)getIndexBuffer().getData();
}
virtual u32 getIndexCount() const
{
return getIndexBuffer().size();
}
virtual const core::vector3df& getPosition(u32 i) const
{
return getVertexBuffer()[i].Pos;
}
virtual core::vector3df& getPosition(u32 i)
{
return getVertexBuffer()[i].Pos;
}
virtual const core::vector2df& getTCoords(u32 i) const
{
return getVertexBuffer()[i].TCoords;
}
virtual core::vector2df& getTCoords(u32 i)
{
return getVertexBuffer()[i].TCoords;
}
virtual const core::vector3df& getNormal(u32 i) const
{
return getVertexBuffer()[i].Normal;
}
virtual core::vector3df& getNormal(u32 i)
{
return getVertexBuffer()[i].Normal;
}
};
} // end namespace scene
} // end namespace irr
#endif
IIndexBuffer.h
IMeshBuffer.h
IVertexBuffer.h
irr::scene::IDynamicMeshBuffer
Definition IDynamicMeshBuffer.h:19
irr::scene::IDynamicMeshBuffer::getMaterial
virtual const video::SMaterial & getMaterial() const =0
Get the material of this meshbuffer.
irr::scene::IDynamicMeshBuffer::recalculateBoundingBox
virtual void recalculateBoundingBox()=0
Recalculates the bounding box. Should be called if the mesh changed.
irr::scene::IDynamicMeshBuffer::setVertexBuffer
virtual void setVertexBuffer(IVertexBuffer *vertexBuffer)=0
irr::scene::IDynamicMeshBuffer::append
virtual void append(const void *const vertices, u32 numVertices, const u16 *const indices, u32 numIndices)
Append the vertices and indices to the current buffer.
Definition IDynamicMeshBuffer.h:53
irr::scene::IDynamicMeshBuffer::getTCoords
virtual const core::vector2df & getTCoords(u32 i) const
returns texture coords of vertex i
Definition IDynamicMeshBuffer.h:181
irr::scene::IDynamicMeshBuffer::getChangedID_Index
virtual u32 getChangedID_Index() const
Get the currently used ID for identification of changes.
Definition IDynamicMeshBuffer.h:103
irr::scene::IDynamicMeshBuffer::getChangedID_Vertex
virtual u32 getChangedID_Vertex() const
Get the currently used ID for identification of changes.
Definition IDynamicMeshBuffer.h:98
irr::scene::IDynamicMeshBuffer::setIndexBuffer
virtual void setIndexBuffer(IIndexBuffer *indexBuffer)=0
irr::scene::IDynamicMeshBuffer::getIndexType
virtual video::E_INDEX_TYPE getIndexType() const
Get type of index data which is stored in this meshbuffer.
Definition IDynamicMeshBuffer.h:142
irr::scene::IDynamicMeshBuffer::getVertexType
virtual video::E_VERTEX_TYPE getVertexType() const
Get type of vertex data which is stored in this meshbuffer.
Definition IDynamicMeshBuffer.h:112
irr::scene::IDynamicMeshBuffer::getHardwareMappingHint_Index
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const
get the current hardware mapping hint
Definition IDynamicMeshBuffer.h:75
irr::scene::IDynamicMeshBuffer::getIndices
virtual u16 * getIndices()
Get access to Indices.
Definition IDynamicMeshBuffer.h:156
irr::scene::IDynamicMeshBuffer::getVertices
virtual const void * getVertices() const
Get access to vertex data. The data is an array of vertices.
Definition IDynamicMeshBuffer.h:120
irr::scene::IDynamicMeshBuffer::getHardwareMappingHint_Vertex
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const
get the current hardware mapping hint
Definition IDynamicMeshBuffer.h:69
irr::scene::IDynamicMeshBuffer::getNormal
virtual const core::vector3df & getNormal(u32 i) const
returns normal of vertex i
Definition IDynamicMeshBuffer.h:193
irr::scene::IDynamicMeshBuffer::getIndices
virtual const u16 * getIndices() const
Get access to Indices.
Definition IDynamicMeshBuffer.h:149
irr::scene::IDynamicMeshBuffer::getVertexBuffer
virtual IVertexBuffer & getVertexBuffer() const =0
irr::scene::IDynamicMeshBuffer::getPosition
virtual const core::vector3df & getPosition(u32 i) const
returns position of vertex i
Definition IDynamicMeshBuffer.h:169
irr::scene::IDynamicMeshBuffer::setHardwareMappingHint
virtual void setHardwareMappingHint(E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX)
set the hardware mapping hint, for driver
Definition IDynamicMeshBuffer.h:81
irr::scene::IDynamicMeshBuffer::getPosition
virtual core::vector3df & getPosition(u32 i)
returns position of vertex i
Definition IDynamicMeshBuffer.h:175
irr::scene::IDynamicMeshBuffer::append
virtual void append(const IMeshBuffer *const other)
Append the meshbuffer to the current buffer.
Definition IDynamicMeshBuffer.h:61
irr::scene::IDynamicMeshBuffer::getVertices
virtual void * getVertices()
Get access to vertex data. The data is an array of vertices.
Definition IDynamicMeshBuffer.h:128
irr::scene::IDynamicMeshBuffer::getTCoords
virtual core::vector2df & getTCoords(u32 i)
returns texture coords of vertex i
Definition IDynamicMeshBuffer.h:187
irr::scene::IDynamicMeshBuffer::getMaterial
virtual video::SMaterial & getMaterial()=0
Get the material of this meshbuffer.
irr::scene::IDynamicMeshBuffer::getBoundingBox
virtual const core::aabbox3df & getBoundingBox() const =0
Get the axis aligned bounding box of this meshbuffer.
irr::scene::IDynamicMeshBuffer::setBoundingBox
virtual void setBoundingBox(const core::aabbox3df &box)=0
Set axis aligned bounding box.
irr::scene::IDynamicMeshBuffer::getIndexCount
virtual u32 getIndexCount() const
Get amount of indices in this meshbuffer.
Definition IDynamicMeshBuffer.h:163
irr::scene::IDynamicMeshBuffer::getNormal
virtual core::vector3df & getNormal(u32 i)
returns normal of vertex i
Definition IDynamicMeshBuffer.h:199
irr::scene::IDynamicMeshBuffer::setDirty
virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX)
flags the mesh as changed, reloads hardware buffers
Definition IDynamicMeshBuffer.h:90
irr::scene::IDynamicMeshBuffer::getIndexBuffer
virtual IIndexBuffer & getIndexBuffer() const =0
irr::scene::IDynamicMeshBuffer::getVertexCount
virtual u32 getVertexCount() const
Get amount of vertices in meshbuffer.
Definition IDynamicMeshBuffer.h:135
irr::scene::IIndexBuffer
Definition IIndexBuffer.h:25
irr::scene::IIndexBuffer::size
virtual u32 size() const =0
irr::scene::IIndexBuffer::setDirty
virtual void setDirty()=0
flags the meshbuffer as changed, reloads hardware buffers
irr::scene::IIndexBuffer::getHardwareMappingHint
virtual E_HARDWARE_MAPPING getHardwareMappingHint() const =0
get the current hardware mapping hint
irr::scene::IIndexBuffer::getData
virtual void * getData()=0
irr::scene::IIndexBuffer::getChangedID
virtual u32 getChangedID() const =0
Get the currently used ID for identification of changes.
irr::scene::IIndexBuffer::setHardwareMappingHint
virtual void setHardwareMappingHint(E_HARDWARE_MAPPING NewMappingHint)=0
set the hardware mapping hint, for driver
irr::scene::IIndexBuffer::getType
virtual video::E_INDEX_TYPE getType() const =0
irr::scene::IMeshBuffer
Struct for holding a mesh with a single material.
Definition IMeshBuffer.h:40
irr::scene::IVertexBuffer
Definition IVertexBuffer.h:18
irr::scene::IVertexBuffer::getType
virtual video::E_VERTEX_TYPE getType() const =0
irr::scene::IVertexBuffer::getData
virtual void * getData()=0
irr::scene::IVertexBuffer::size
virtual u32 size() const =0
irr::scene::IVertexBuffer::getHardwareMappingHint
virtual E_HARDWARE_MAPPING getHardwareMappingHint() const =0
get the current hardware mapping hint
irr::scene::IVertexBuffer::getChangedID
virtual u32 getChangedID() const =0
Get the currently used ID for identification of changes.
irr::scene::IVertexBuffer::setHardwareMappingHint
virtual void setHardwareMappingHint(E_HARDWARE_MAPPING NewMappingHint)=0
set the hardware mapping hint, for driver
irr::scene::IVertexBuffer::setDirty
virtual void setDirty()=0
flags the meshbuffer as changed, reloads hardware buffers
irr::video::SMaterial
Struct for holding parameters for a material renderer.
Definition SMaterial.h:227
irr::core::vector3df
vector3d< f32 > vector3df
Typedef for a f32 3d vector.
Definition vector3d.h:445
irr::core::vector2df
vector2d< f32 > vector2df
Typedef for f32 2d vector.
Definition vector2d.h:323
irr::core::aabbox3df
aabbox3d< f32 > aabbox3df
Typedef for a f32 3d bounding box.
Definition aabbox3d.h:324
irr::scene
All scene management can be found in this namespace: Mesh loading, special scene nodes like octrees a...
Definition CDynamicMeshBuffer.h:16
irr::scene::E_BUFFER_TYPE
E_BUFFER_TYPE
Definition EHardwareBufferFlags.h:29
irr::scene::EBT_VERTEX_AND_INDEX
@ EBT_VERTEX_AND_INDEX
Change both vertex and index mapping to the same value.
Definition EHardwareBufferFlags.h:37
irr::scene::EBT_INDEX
@ EBT_INDEX
Change the index mapping.
Definition EHardwareBufferFlags.h:35
irr::scene::EBT_VERTEX
@ EBT_VERTEX
Change the vertex mapping.
Definition EHardwareBufferFlags.h:33
irr::scene::E_HARDWARE_MAPPING
E_HARDWARE_MAPPING
Definition EHardwareBufferFlags.h:14
irr::video::E_VERTEX_TYPE
E_VERTEX_TYPE
Enumeration for all vertex types there are.
Definition S3DVertex.h:19
irr::video::E_INDEX_TYPE
E_INDEX_TYPE
Definition SVertexIndex.h:16
irr
Everything in the Irrlicht Engine can be found in this namespace.
Definition aabbox3d.h:13
irr::u32
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58
irr::u16
unsigned short u16
16 bit unsigned variable.
Definition irrTypes.h:40
- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0