[ODE] Collision Trimesh-Box

Oleh Derevenko oder at eleks.lviv.ua
Tue Aug 7 10:56:54 MST 2007


Hi

I try to set up collision checking in my application. It works already for 
simple shapes (e.g. box-box) and now I try to make it work for trimeshes but 
with little succes.

So, I have ODE library compiled with OPCODE.
I create a mesh like this:

===========
 dTriMeshDataID idMeshData = dGeomTriMeshDataCreate();

 dGeomTriMeshDataBuildSingle(idMeshData, pflMeshPointArray, SA__MAX * 
sizeof(spcodefloat), nMeshPointCount, puiFacePointIndiceArray, nFaceCount * 
SMEM__MAX, SMEM__MAX * sizeof(spcindex));

 dGeomTriMeshDataPreprocess(idMeshData);

 dGeomID idMeshGeom = dCreateTriMesh(idComplexObjectSpace, idMeshData, NULL, 
NULL, NULL);
===========

Then I position the mesh with calls to dGeomSetPosition() and 
dGeomSetRotation() and set last transformation to the same value (there was 
no position change yet) with dGeomTriMeshSetLastTransform(), having the 4th 
column of last_trans initialized with (0, 0, 0, 1).

And when I call dCollide() for that mesh and a box requesting a single 
ContactGeom I get zero as a result even though I'm sure the mesh is OK and I 
know there must be a collision.
I've traced ODE code until OPC_OBBCollider.cpp and AABBs intersect quite a 
lot. Actually, half of a mesh is inside the box. But when the collider is 
invoked it returns no result.

Could anybody suggest what is wrong with my approach?

Oleh Derevenko
-- Yahoo ID: oleh_derevenko
-- ICQ: 36361783 




More information about the ODE mailing list