5#ifndef __I_MESH_BUFFER_H_INCLUDED__
6#define __I_MESH_BUFFER_H_INCLUDED__
8#include "IReferenceCounted.h"
12#include "IVertexDescriptor.h"
13#include "CVertexBuffer.h"
14#include "CIndexBuffer.h"
15#include "EHardwareBufferFlags.h"
16#include "EPrimitiveTypes.h"
49 virtual ~IMeshBuffer() {}
55 virtual bool addVertexBuffer(
IVertexBuffer* vertexBuffer) = 0;
59 virtual u32 getVertexBufferCount()
const = 0;
61 virtual void removeVertexBuffer(
u32 id) = 0;
68 return VertexBufferCompatible;
73 virtual bool setIndexBuffer(
IIndexBuffer* indexBuffer) = 0;
78 u32 primitiveCount = 0;
80 switch (PrimitiveType)
106 return primitiveCount;
112 return PrimitiveType;
118 PrimitiveType = primitiveType;
150 virtual void append(IMeshBuffer* meshBuffer) = 0;
174 virtual void setUseForHardwareInstancing(
bool b) = 0;
176 virtual bool useForHardwareInstancing() = 0;
183 bool VertexBufferCompatible;
198 bool BoundingBoxNeedsRecalculated;
207 bool UseForHardwareInstancing;
IReferenceCounted()
Constructor.
Definition IReferenceCounted.h:50
Axis aligned bounding box in 3d dimensional space.
Definition aabbox3d.h:22
Self reallocating template array (like stl vector) with additional features.
Definition irrArray.h:23
Definition IIndexBuffer.h:25
virtual void recalculateBoundingBox()=0
Recalculates the bounding box. Should be called if the mesh changed.
core::array< scene::IVertexBuffer * > VertexBuffer
Vertex buffer array.
Definition IMeshBuffer.h:186
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const =0
get the current hardware mapping hint
E_PRIMITIVE_TYPE getPrimitiveType() const
Get primitive type.
Definition IMeshBuffer.h:110
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex(u32 id=0) const =0
get the current hardware mapping hint
video::IVertexDescriptor * VertexDescriptor
Vertex descriptor.
Definition IMeshBuffer.h:180
core::aabbox3d< f32 > BoundingBox
Bounding box.
Definition IMeshBuffer.h:201
virtual u32 getChangedID_Vertex(u32 id=0) const =0
Get the currently used ID for identification of changes.
virtual void setHardwareMappingHint(E_HARDWARE_MAPPING pMappingHint, E_BUFFER_TYPE type=EBT_VERTEX_AND_INDEX, u32 id=0)=0
set the hardware mapping hint, for driver
virtual void append(IMeshBuffer *meshBuffer)=0
Append the meshbuffer to the current buffer.
bool isVertexBufferCompatible() const
Inform if stored vertex buffers have the same vertex descriptors.
Definition IMeshBuffer.h:66
virtual void setDirty(E_BUFFER_TYPE type=EBT_VERTEX_AND_INDEX, u32 id=0)=0
flags the meshbuffer as changed, reloads hardware buffers
u32 getPrimitiveCount() const
Get primitive count.
Definition IMeshBuffer.h:76
virtual core::aabbox3df & getBoundingBox()=0
Get the axis aligned bounding box of this meshbuffer.
void setPrimitiveType(E_PRIMITIVE_TYPE primitiveType)
Set primitive type.
Definition IMeshBuffer.h:116
virtual video::SMaterial & getMaterial()=0
Get the material of this meshbuffer.
scene::IIndexBuffer * IndexBuffer
Index buffer.
Definition IMeshBuffer.h:189
virtual void boundingBoxNeedsRecalculated()=0
Call this after changing the positions of any vertex.
virtual const core::aabbox3df & getBoundingBox() const =0
Get the axis aligned bounding box of this meshbuffer.
video::SMaterial Material
Material.
Definition IMeshBuffer.h:195
virtual u32 getChangedID_Index() const =0
Get the currently used ID for identification of changes.
virtual const video::SMaterial & getMaterial() const =0
Get the material of this meshbuffer.
Definition IVertexBuffer.h:17
Definition IVertexDescriptor.h:154
Struct for holding parameters for a material renderer.
Definition SMaterial.h:255
CMatrix4< f32 > matrix4
Typedef for f32 matrix.
Definition matrix4.h:2241
aabbox3d< f32 > aabbox3df
Typedef for a f32 3d bounding box.
Definition aabbox3d.h:351
All scene management can be found in this namespace: Mesh loading, special scene nodes like octrees a...
Definition CIndexBuffer.h:13
E_PRIMITIVE_TYPE
Enumeration for all primitive types there are.
Definition EPrimitiveTypes.h:15
@ EPT_LINES
Every two vertices are connected creating n/2 lines.
Definition EPrimitiveTypes.h:26
@ EPT_POINTS
All vertices are non-connected points.
Definition EPrimitiveTypes.h:17
@ EPT_TRIANGLES
Explicitly set all vertices for each triangle.
Definition EPrimitiveTypes.h:37
@ EPT_LINE_STRIP
All vertices form a single connected line.
Definition EPrimitiveTypes.h:20
@ EPT_TRIANGLE_FAN
Definition EPrimitiveTypes.h:34
@ EPT_TRIANGLE_STRIP
Definition EPrimitiveTypes.h:30
@ EPT_POINT_SPRITES
The single vertices are expanded to quad billboards on the GPU.
Definition EPrimitiveTypes.h:40
@ EPT_LINE_LOOP
Just as LINE_STRIP, but the last and the first vertex is also connected.
Definition EPrimitiveTypes.h:23
E_BUFFER_TYPE
Definition EHardwareBufferFlags.h:29
@ EBT_VERTEX_AND_INDEX
Change both vertex and index mapping to the same value.
Definition EHardwareBufferFlags.h:37
E_HARDWARE_MAPPING
Definition EHardwareBufferFlags.h:14
E_VERTEX_TYPE
Enumeration for all vertex types there are.
Definition S3DVertex.h:19
Everything in the Irrlicht Engine can be found in this namespace.
Definition Skylicht.h:33
unsigned int u32
32 bit unsigned variable.
Definition irrTypes.h:58