mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-05 01:30:26 +02:00
Add IMeshBufffer::clone for buffer copies, use it in CMeshManipulator::createMeshCopy
CMeshManipulator::createMeshCopy creates new meshes which have copies of the actual meshbuffers instead of copying everything into SMeshBuffers (which didn't support 32 bit or any of the other special features). git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6335 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@ -389,6 +389,35 @@ struct SSkinMeshBuffer : public IMeshBuffer
|
||||
return EMBT_SKIN;
|
||||
}
|
||||
|
||||
//! Create copy of the meshbuffer
|
||||
virtual IMeshBuffer* createClone(int cloneFlags) const IRR_OVERRIDE
|
||||
{
|
||||
SSkinMeshBuffer* clone = new SSkinMeshBuffer(VertexType);
|
||||
|
||||
if (cloneFlags & ECF_VERTICES)
|
||||
{
|
||||
clone->Vertices_Tangents = Vertices_Tangents;
|
||||
clone->Vertices_2TCoords = Vertices_2TCoords;
|
||||
clone->Vertices_Standard = Vertices_Standard;
|
||||
|
||||
clone->BoundingBox = BoundingBox;
|
||||
clone->BoundingBoxNeedsRecalculated = BoundingBoxNeedsRecalculated;
|
||||
}
|
||||
|
||||
if (cloneFlags & ECF_INDICES)
|
||||
{
|
||||
clone->Indices = Indices;
|
||||
}
|
||||
|
||||
clone->Transformation = Transformation;
|
||||
clone->Material = getMaterial();
|
||||
clone->PrimitiveType = PrimitiveType;
|
||||
clone->MappingHint_Vertex = MappingHint_Vertex;
|
||||
clone->MappingHint_Index = MappingHint_Index;
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
//! Call this after changing the positions of any vertex.
|
||||
void boundingBoxNeedsRecalculated(void) { BoundingBoxNeedsRecalculated = true; }
|
||||
|
||||
|
Reference in New Issue
Block a user