8#include "SMeshBuffer.h"
37 core::array<s32>
addMesh(IMesh* mesh,
38 core::vector3df pos = core::vector3df(0,0,0),
39 core::vector3df rot = core::vector3df(0,0,0),
40 core::vector3df scale = core::vector3df(1,1,1));
44 core::array<s32>
addMesh(IMesh* mesh,
const core::matrix4 &transform);
49 core::vector3df pos = core::vector3df(0,0,0),
50 core::vector3df rot = core::vector3df(0,0,0),
51 core::vector3df scale = core::vector3df(1,1,1));
55 s32
addMeshBuffer(IMeshBuffer* buffer,
const core::matrix4 &transform);
63 core::array<bool>
moveMesh(
const core::array<s32>& bufferIDs,
const core::matrix4 &newMatrix);
96 virtual IMeshBuffer*
getMeshBuffer(
const video::SMaterial &material)
const;
108 virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag,
bool newvalue);
110 virtual void setHardwareMappingHint(E_HARDWARE_MAPPING mapping, E_BUFFER_TYPE type);
112 virtual void setDirty(E_BUFFER_TYPE type);
117 void addSourceBuffer(IMeshBuffer* source);
120 void updateDestFromSourceBuffer(u32
id);
123 void recalculateDestBufferBoundingBox(u32 i);
128 : SourceBuffer(0), DestReference(0), FirstVertex(0), VertexCount(0),
129 FirstIndex(0), IndexCount(0), Initialized(
false) { }
131 IMeshBuffer* SourceBuffer;
133 u32 FirstVertex, VertexCount, FirstIndex, IndexCount;
134 core::matrix4 Transform;
141 video::E_VERTEX_TYPE VertexType;
148 video::E_VERTEX_TYPE VertexType;
157 core::array<SBufferReference> BufferReferences;
158 core::array<SMaterialReference> MaterialReferences;
159 core::array<SDestBufferReference> DestBuffers;
Definition: material.hpp:48
Definition: CBatchingMesh.hpp:16
void finalize()
first updates the mesh, then drops all source buffers.
Definition: CBatchingMesh.cpp:317
void recalculateBoundingBox()
updates bouding box from internal buffers
Definition: CBatchingMesh.cpp:231
core::array< IMeshBuffer * > SourceBuffers
Source mesh buffers, these are locked.
Definition: CBatchingMesh.hpp:155
core::array< s32 > addMesh(IMesh *mesh, core::vector3df pos=core::vector3df(0, 0, 0), core::vector3df rot=core::vector3df(0, 0, 0), core::vector3df scale=core::vector3df(1, 1, 1))
adds a mesh to the buffers with the given offset
Definition: CBatchingMesh.cpp:100
virtual IMeshBuffer * getMeshBuffer(u32 nr) const
Returns pointer to a mesh buffer.
Definition: CBatchingMesh.cpp:260
bool moveMeshBuffer(const s32 id, const core::matrix4 &newMatrix)
Moves a mesh buffer.
Definition: CBatchingMesh.cpp:342
bool IsFinal
can it be changed?
Definition: CBatchingMesh.hpp:168
s32 addMeshBuffer(IMeshBuffer *buffer, core::vector3df pos=core::vector3df(0, 0, 0), core::vector3df rot=core::vector3df(0, 0, 0), core::vector3df scale=core::vector3df(1, 1, 1))
adds a mesh buffer with the given transformation
Definition: CBatchingMesh.cpp:130
bool IsDirty
does it require an update?
Definition: CBatchingMesh.hpp:165
virtual void setBoundingBox(const core::aabbox3df &box)
set user axis aligned bounding box
Definition: CBatchingMesh.cpp:282
IMeshBuffer * getSourceBuffer(s32 id)
returns the source buffer, if available
Definition: CBatchingMesh.cpp:361
virtual const core::aabbox3d< f32 > & getBoundingBox() const
Returns an axis aligned bounding box of the mesh.
Definition: CBatchingMesh.cpp:276
void update()
refreshes the internal buffers from source
Definition: CBatchingMesh.cpp:34
u32 getSourceBufferCount() const
returns the number of source buffers
Definition: CBatchingMesh.cpp:383
virtual u32 getMeshBufferCount() const
Returns the amount of mesh buffers.
Definition: CBatchingMesh.cpp:250
core::matrix4 getSourceBufferMatrix(s32 id)
returns the matrix of the source buffer
Definition: CBatchingMesh.cpp:370
core::aabbox3d< f32 > Box
bounding containing all destination buffers
Definition: CBatchingMesh.hpp:162
virtual void setMaterialFlag(video::E_MATERIAL_FLAG flag, bool newvalue)
Sets a flag of all contained materials to a new value.
Definition: CBatchingMesh.cpp:290
bool isDirty(s32 id=-1)
returns true if new buffers have been added without updating the internal buffers
Definition: CBatchingMesh.cpp:25
void clear()
drops all buffers and clears internal states
Definition: CBatchingMesh.cpp:297
core::array< bool > moveMesh(const core::array< s32 > &bufferIDs, const core::matrix4 &newMatrix)
Moves a mesh,.
Definition: CBatchingMesh.cpp:330
Definition: CBatchingMesh.hpp:126
Definition: CBatchingMesh.hpp:146
Definition: CBatchingMesh.hpp:139