[ODE] Trimesh Collision Issues

James Dolan jdolan at gmail.com
Sun Jul 17 11:42:53 MST 2005


trimesh-trimesh collision isn't really practical. You probably should
end up only using triangle meshes only for your static geometry and
use basic primitives for your dynamic geometry.

Anyways, you answer the question as to what you missed.... In dCollide
the lower 16 bits of the flags field is for the number of contacts in
your contact array (I think 0 really means 1, but you can never be too
sure). Anyways, try creating more than 1 contact, also try using
meshes that have more than 1 triangle.

-james


On 7/17/05, Brian Uptagrafft <instruo at hotmail.com> wrote:
> Hi everyone,
> 
> I'm quite new to ODE (great job, btw, to everyone involved!) and at the
> moment I'm simply looking to wrap the trimesh-trimesh collision
> functionality into my .Net application.  Everything is trucking along fine,
> save I throw an exception when I try to use dCollide with my pair of
> trimeshes.  My code is posted below (note:  the ODE::ode_method_name  is
> simply passed through to the ode.dll via the .Net InteropServices and
> doesn't seem to be the problem, by and large, because all of the other
> functions besides dCollide are behaving).  Oh, and I'm linking to the
> ode-bin-0.5-msvc-dll-SINGLE-release-trimesh version of the dll.  Here's the
> code, and hopefully you can see something I've missed.  Thanks!
> 
> int data_id = ODE::dGeomTriMeshDataCreate();
> int data_id2 = ODE::dGeomTriMeshDataCreate();
> 
> dVector3 verts[3];
> 
> verts[0][0] = 0.0;
> verts[0][1] = 0.0;
> verts[0][2] = 0.0;
> 
> verts[1][0] = 1.0;
> verts[1][1] = 0.0;
> verts[1][2] = 0.0;
> 
> verts[2][0] = 1.0;
> verts[2][1] = 1.0;
> verts[2][2] = 0.0;
> 
> int indices[3];
> indices[0] = 0;
> indices[1] = 1;
> indices[2] = 2;
> 
> dVector3 verts2[3];
> 
> verts2[0][0] = 0.0;
> verts2[0][1] = 0.0;
> verts2[0][2] = 0.0;
> 
> verts2[1][0] = 1.0;
> verts2[1][1] = 0.0;
> verts2[1][2] = 0.0;
> 
> verts2[2][0] = 1.0;
> verts2[2][1] = 1.0;
> verts2[2][2] = 0.0;
> 
> int indices2[3];
> indices2[0] = 0;
> indices2[1] = 1;
> indices2[2] = 2;
> 
> ODE::dGeomTriMeshDataBuildSimple( data_id, verts, 3, indices, 3);
> 
> ODE::dGeomTriMeshDataBuildSimple( data_id2, verts, 3, indices, 3);
> 
> int space_id = ODE::dSimpleSpaceCreate(0);
> 
> int geom_id = ODE::dCreateTriMesh(space_id, data_id);
> int geom_id2 = ODE::dCreateTriMesh(space_id, data_id2);
> 
> dContactGeom contacts[1];
> 
> cout << ODE::dCollide(geom_id, geom_id2, 0, contacts, sizeof(dContactGeom))
> << endl;
> 
> 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>



More information about the ODE mailing list