[ODE] Collision Trimesh-Box

Jon Watte (ODE) hplus-ode at mindcontrol.org
Wed Aug 8 01:34:58 MST 2007


What happens if you reverse the winding of all the faces?

Also, trimesh objects are paper thin -- if the box is entirely inside 
the trimesh, there will not be a collision. Only intersecting triangles 
are reported.

Cheers,

          / h+


Oleh Derevenko wrote:
> 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 
>
>
> _______________________________________________
> ODE mailing list
> ODE at ode.org
> http://ode.org/mailman/listinfo/ode
>
>
>   


More information about the ODE mailing list