[ODE] dCollide crashing???

Fabian Mathews supagu at hotmail.com
Mon Feb 2 11:50:40 MST 2004


Hi,

dCollide crashes when checking using my triangle mesh against a sphere.

in my dSpaceCollide callback:

	const int N = 10;
	dContact contact[N];

	int n = dCollide( o1, o2 ,N, &contact[0].geom, sizeof(dContact) );


and here is my triangle mesh code:

	const int VertexCount =5;
	const int IndexCount =12;
	dVector3 Size;

	Size[0] = 5000.0f;
  Size[1] = 5000.0f;
  Size[2] = 5000.0f;

	dVector3 Vertices[VertexCount];
	int Indices[IndexCount];

	Vertices[0][0] = -Size[0];
  Vertices[0][1] = -Size[1];
  Vertices[0][2] = Size[2];

  Vertices[1][0] = Size[0];
  Vertices[1][1] = -Size[1];
  Vertices[1][2] = Size[2];

  Vertices[2][0] = Size[0];
  Vertices[2][1] = Size[1];
  Vertices[2][2] = Size[2];

  Vertices[3][0] = -Size[0];
  Vertices[3][1] = Size[1];
  Vertices[3][2] = Size[2];

  Vertices[4][0] = 0;
  Vertices[4][1] = 0;
  Vertices[4][2] = 0;

  Indices[0] = 0;
  Indices[1] = 1;
  Indices[2] = 4;

  Indices[3] = 1;
  Indices[4] = 2;
  Indices[5] = 4;

  Indices[6] = 2;
  Indices[7] = 3;
  Indices[8] = 4;

  Indices[9] = 3;
  Indices[10] = 0;
  Indices[11] = 4;

	terrain = dGeomTriMeshDataCreate();

	dGeomTriMeshDataBuildSingleSimple(terrain, (dReal*)Vertices, VertexCount, 
Indices, IndexCount);

	geom = dCreateTriMesh(ENGINE.GetCollisionMgr()->space, terrain, 0, 0, 0);

pretty much ripped strait outta test_trimesh sample...
so i dont see why it should be failing unless im doing something wrong?


-------------------------------
Fabian "SupaGu" Mathews

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail



More information about the ODE mailing list