Original Post
Hi,
i have a Question about my CopyConstructor,
anyone knows why that dont work ????
The Program crasged when it''s call the Destructor
CMSModel(const CMSModel ∥)
{
m_position=par.m_position;
m_timedelta=par.m_timedelta;
m_velocity=par.m_velocity;
m_speed=par.m_speed;
m_numMeshes=par.m_numMeshes;
m_pMeshes=new Mesh[m_numMeshes];
m_pMeshes=par.m_pMeshes;
m_numMaterials=par.m_numMaterials;
m_pMaterials=new Material[m_numMaterials];
m_pMaterials=par.m_pMaterials;
m_numTriangles=par.m_numTriangles;
m_pTriangles=new Triangle[m_numTriangles];
m_pTriangles=par.m_pTriangles;
m_numVertices=par.m_numVertices;
m_pVertices= new Vertex[m_numVertices];
m_pVertices=par.m_pVertices;
Texture=par.Texture;
}
CMSModel *Model=new CMSModel();
Here is the Code to Copy
CMSModel *newModel=new CMSModel(*Model);
wolf