[ODE] Trimesh collision problem

Jürgen Ladstätter info at innova-studios.com
Tue Mar 20 08:08:32 MST 2007


Hi there Jon,

those variables are created and allocated in this function. They are never
used outside and there is no collision detection outside of this function.
So the values stay correct

-----Ursprüngliche Nachricht-----
Von: Jon Watte (ODE) [mailto:hplus-ode at mindcontrol.org] 
Gesendet: Dienstag, 20. März 2007 16:07
An: Jürgen Ladstätter
Cc: ode at ode.org
Betreff: Re: [ODE] Trimesh collision problem

Are dVertex and iPoly globals or class members? ODE does not copy the 
triangle data; you have to make sure it stays valid.

Cheers,

          / h+


Jürgen Ladstätter wrote:
> Hi all,
> Currently I'm trying to do some trimesh collision with a single triangle,
> but the collision does not occur :(
> Precompiler Flag dTRIMESH_ENABLED is set, sourcecode looks as follows:
>
>
> 		// 1st Vertexpoint coordinates
> 		dVertex[0] = 0;
> 		dVertex[1] = 297;
> 		dVertex[2] = 800;
> 		// 2nd Vertexpoint coordinates
> 		dVertex[3] = 297;
> 		dVertex[4] = 297;
> 		dVertex[5] = 800;
> 		// 3rd Vertexpoint coordinates
> 		dVertex[6] = 297;
> 		dVertex[7] = 0;
> 		dVertex[8] = 800;
>
> 		// Polygon combo
> 		iPoly[0] = 0;
> 		iPoly[1] = 1;
> 		iPoly[2] = 2;
>
> 		dTriMeshDataID idTrimeshData = dGeomTriMeshDataCreate();
> 		dGeomTriMeshDataBuildSimple( idTrimeshData, dVertex, 3,
> iPoly, 1);
> 		dGeomID idTrimesh = dCreateTriMesh( g_ikCDSpace,
> idTrimeshData, NULL, NULL, NULL );
> 		// create an ODE ray within the global Space and the length
> of the Renderdevice Z distance
> 		dGeomID ray = dCreateRay( g_ikCDSpace,
> g_pkGameShell->GetRenderDevice()->GetZFar() );
> 		dGeomRaySet( ray, 280, 280, 780, 280, 280, 820 );
>
> 		dContactGeom contact;
> 		if( dCollide( ray, idTrimesh, 0, &contact,
> sizeof(dContactGeom) ) != 0)
> 			log << "yes";
>
> 		dGeomTriMeshDataDestroy(idTrimeshData);
>
>
> maybe you find anything?
> Kind regards, juergen
>
> _______________________________________________
> ODE mailing list
> ODE at ode.org
> http://mooshika.org/mailman/listinfo/ode
>
>
>   




More information about the ODE mailing list