[ODE] Trimesh collision problem
Jürgen Ladstätter
info at innova-studios.com
Tue Mar 20 05:31:07 MST 2007
Hi all,
Currently I'm trying to do some trimesh collision with a single triangle,
but the collision does not occur :(
Precompiler Flag dTRIMESH_ENABLED is set, sourcecode looks as follows:
// 1st Vertexpoint coordinates
dVertex[0] = 0;
dVertex[1] = 297;
dVertex[2] = 800;
// 2nd Vertexpoint coordinates
dVertex[3] = 297;
dVertex[4] = 297;
dVertex[5] = 800;
// 3rd Vertexpoint coordinates
dVertex[6] = 297;
dVertex[7] = 0;
dVertex[8] = 800;
// Polygon combo
iPoly[0] = 0;
iPoly[1] = 1;
iPoly[2] = 2;
dTriMeshDataID idTrimeshData = dGeomTriMeshDataCreate();
dGeomTriMeshDataBuildSimple( idTrimeshData, dVertex, 3,
iPoly, 1);
dGeomID idTrimesh = dCreateTriMesh( g_ikCDSpace,
idTrimeshData, NULL, NULL, NULL );
// create an ODE ray within the global Space and the length
of the Renderdevice Z distance
dGeomID ray = dCreateRay( g_ikCDSpace,
g_pkGameShell->GetRenderDevice()->GetZFar() );
dGeomRaySet( ray, 280, 280, 780, 280, 280, 820 );
dContactGeom contact;
if( dCollide( ray, idTrimesh, 0, &contact,
sizeof(dContactGeom) ) != 0)
log << "yes";
dGeomTriMeshDataDestroy(idTrimeshData);
maybe you find anything?
Kind regards, juergen
More information about the ODE
mailing list