i working on convert from the ODE Tut
There where "Converting Irrlicht Meshes to ODE TriMesh"
The Problem is how can/must i convert a Vertex[] to a Float[] in C#?
I have a problem with understanding the way of c++

There was deklair a Vector3-Array (vertices[])
Now there where fill with value (vertices[cv][0]=mb_vertices[j].Pos.X,...)
Later... a Function would like a Array of Float with Vertex Datas. The Vector3-Array will consign to (dReal*)vertices.
Code: Select all
vertices=new dVector3[vertexcount];
for(j=0;j<mb->getVertexCount();j++){
vertices[cv][0]=mb_vertices[j].Pos.X;
vertices[cv][1]=mb_vertices[j].Pos.Y;
vertices[cv][2]=mb_vertices[j].Pos.Z;
cv++;
}
dGeomTriMeshDataBuildSimple(data,(dReal*)vertices, vertexcount, indices, indexcount);
Code: Select all
vertices = new Vector3[vertexcount];
for(j=0;j<mb.VertexCount;j++){
vertices[cv] = mb.GetVertex(j).Position;
cv++;
}
GeomTriMeshDataBuildSimple(data,(float[])vertices, vertexcount, indices, indexcount);