[ODE] More tri-collider questions
nlin@nlin.net
nlin at nlin.net
Sun Jun 23 14:55:02 2002
Hi,
Thanks to the author's help I was able to compile the tri-collider -
I needed to modify opcode to compile it as a static library, then
compile the files in the tri-collider directory as a static library,
then link my test app against both libraries.
Now that it's compiling, there's the small problem of getting it
to run :-)
My problem is that no contacts seem to be generated for my simple
test of colliding a sphere with a 2-triangle terrain. My test program
is a modified test_boxstack where I drop spheres at 0,0,0 onto a test
triangle mesh consisting of points created with the following code:
trilist = dCreateTriList(space, NULL,NULL);
dcVector3 vertices[10];
int vertexcount;
int indices[10];
int indexcount;
vertexcount=0;
vertices[vertexcount].x = 0.0;
vertices[vertexcount].y = 0.0;
vertices[vertexcount].z = 0.0;
vertexcount++;
vertices[vertexcount].x = 1.0;
vertices[vertexcount].y = 0.0;
vertices[vertexcount].z = 1.0;
vertexcount++;
vertices[vertexcount].x = 0.0;
vertices[vertexcount].y = 1.0;
vertices[vertexcount].z = 1.0;
vertexcount++;
vertices[vertexcount].x = 1.0;
vertices[vertexcount].y = 1.0;
vertices[vertexcount].z = 0.0;
vertexcount++;
indexcount=0;
indices[indexcount++] = 0;
indices[indexcount++] = 1;
indices[indexcount++] = 2;
indices[indexcount++] = 3;
indices[indexcount++] = 2;
indices[indexcount++] = 1;
dGeomTriListBuild(trilist, vertices, vertexcount, indices, indexcount);
Then when I run my program, the spheres do collide with the mesh,
but no contacts are getting generated. I put a debug message in
dcTriListCollider::CollideSphere to print out the "TriangleIDCount"
variable right after it is computed. It is always zero.
Any idea what I am doing wrong? I really would like to get this working!
Thanks,
-Norman