Commit 2e38ebd8 authored by Mathias Goldau's avatar Mathias Goldau
Browse files

[ADD] Now the triangle constructor copies the content of our WTriangleMesh2...

[ADD] Now the triangle constructor copies the content of our WTriangleMesh2 into the old mesh, (hopefully the right way)
parent a7bf0e27
......@@ -20,6 +20,17 @@ TriangleMesh::TriangleMesh ( boost::shared_ptr< WTriangleMesh2 > mesh, boost::sh
m_triangleTensorsCalculated = false;
defaultColor = WColor( 0.78, 0.78, 0.78, 1.0 );
// copy vertices
for( size_t i = 0; i < mesh->vertSize(); ++i )
{
wmath::WPosition pos = mesh->getVertexAsPosition( i );
fastAddVert( Vector( pos[0], pos[1], pos[2] ) );
}
// copy triangles
for( size_t i = 0; i < mesh->triangleSize(); ++i )
{
fastAddTriangle( mesh->getTriVertId0( i ), mesh->getTriVertId1( i ), mesh->getTriVertId2( i ) );
}
}
TriangleMesh::~TriangleMesh ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment