Tao.Ode SDK Documentation

Ode.dGeomTriMeshDataBuildSingle Method 

Build Trimesh data with single precision used in vertex data.

[Visual Basic]
Public Shared Sub dGeomTriMeshDataBuildSingle( _
   ByVal g As IntPtr, _
   ByVal Vertices As dVector3(), _
   ByVal VertexStride As Integer, _
   ByVal VertexCount As Integer, _
   ByVal Indices As Integer(), _
   ByVal IndexCount As Integer, _
   ByVal TriStride As Integer _
)
[C#]
public static void dGeomTriMeshDataBuildSingle(
   IntPtr g,
   dVector3[] Vertices,
   int VertexStride,
   int VertexCount,
   int[] Indices,
   int IndexCount,
   int TriStride
);

Parameters

g
A dTriMeshDataID
Vertices
A dVector3[]
VertexStride
An int
VertexCount
An int
Indices
An int[]
IndexCount
An int
TriStride
An int

Remarks

Applies to all the dGeomTriMeshDataBuild single and double versions. (From http://ode.org/ode-latest-userguide.html#sec_10_7_6) Used for filling a dTriMeshData object with data. No data is copied here, so the pointers passed into this function must remain valid. This is how the strided data works: struct StridedVertex { dVector3 Vertex; // 4th component can be left out, reducing memory usage // Userdata }; int VertexStride = sizeof (StridedVertex); struct StridedTri { int Indices[3]; // Userdata }; int TriStride = sizeof (StridedTri); The Normals argument is optional: the normals of the faces of each trimesh object. For example, dTriMeshDataID TriMeshData; TriMeshData = dGeomTriMeshGetTriMeshDataID ( Bodies[BodyIndex].GeomID); // as long as dReal == floats dGeomTriMeshDataBuildSingle (TriMeshData, // Vertices Bodies[BodyIndex].VertexPositions, 3*sizeof(dReal), (int) numVertices, // Faces Bodies[BodyIndex].TriangleIndices, (int) NumTriangles, 3*sizeof(unsigned int), // Normals Bodies[BodyIndex].FaceNormals); This pre-calculation saves some time during evaluation of the contacts, but isn't necessary. If you don't want to calculate the face normals before construction (or if you have enormous trimeshes and know that only very few faces will be touching and want to save time), just pass a "NULL" for the Normals argument, and dCollideTTL will take care of the normal calculations itself.

See Also

Ode Class | Tao.Ode Namespace