Tao.Ode SDK Documentation

Ode.dGeomTriMeshDataSet Method 

In order to efficiently resolve collisions, dCollideTTL needs the positions of the colliding trimeshes in the previous timestep. This is used to calculate an estimated velocity of each colliding triangle, which is used to find the direction of impact, contact normals, etc. This requires the user to update these variables at every timestep. This update is performed outside of ODE, so it is not included in ODE itself. The code to do this looks something like this: const double *DoubleArrayPtr = Bodies[BodyIndex].TransformationMatrix->GetArray(); dGeomTriMeshDataSet( TriMeshData, TRIMESH_LAST_TRANSFORMATION, (void *) DoubleArrayPtr ); The transformation matrix is the standard 4x4 homogeneous transform matrix, and the "DoubleArray" is the standard flattened array of the 16 matrix values.

[Visual Basic]
Public Shared Sub dGeomTriMeshDataSet( _
   ByVal g As IntPtr, _
   ByVal data_id As Integer, _
   ByRef data As IntPtr _
)
[C#]
public static void dGeomTriMeshDataSet(
   IntPtr g,
   int data_id,
   ref IntPtr data
);

Parameters

g
the trimesh dataset handle
data_id
data id, like TRIMESH_LAST_TRANSFORMATION
data
a reference to the "DoubleArray"

See Also

Ode Class | Tao.Ode Namespace