[ODE] collisoin_trimesh_box.cpp bug?
arcad
arcad at orion-mm.ru
Sat Mar 20 11:40:12 MST 2004
Dear ode,
The other day faced with the following problem...
I use TriMesh geom for geometry level.
If on way of the body was a double wall and body moved it is enough quickly, that it was not repulsed, but stuck in wall.
This is because contacts were generated for both polygons with opposite normal.
One contacts tried to pop the body, but others opposite delayed him.
Has fixed this as follows.
In "collision_trimesh_box.cpp" after call FetchTriangle(TriMesh, TriIndex, TLPosition, TLRotation, dv);
has inserted check: where is turned normal of the polygon for the centre of the body.
Here is that was got...
FetchTriangle(TriMesh, TriIndex, TLPosition, TLRotation, dv);
D3DXPLANE plane;
D3DXPlaneFromPoints(&plane,(D3DXVECTOR3*)&dv[0],(D3DXVECTOR3*)&dv[1],(D3DXVECTOR3*)&dv[2]);
if(D3DXPlaneDotCoord(&plane,(D3DXVECTOR3*)&BoxGeom->body->pos)<0)
continue;
//dVector3 vu;
//vu[0] = dv[1][0] - dv[0][0];
//vu[1] = dv[1][1] - dv[0][1];
//vu[2] = dv[1][2] - dv[0][2];
//vu[3] = REAL(0.0);
//dVector3 vv;
//vv[0] = dv[2][0] - dv[0][0];
//vv[1] = dv[2][1] - dv[0][1];
//vv[2] = dv[2][2] - dv[0][2];
//vv[3] = REAL(0.0);
dVector4 Plane;
//dCROSS(Plane, =, vu, vv);
//Plane[3] = dDOT(Plane, dv[0]);
//// Normalize the plane
//dReal Area = dSqrt(dDOT(Plane, Plane));
//Plane[0] /= Area;
//Plane[1] /= Area;
//Plane[2] /= Area;
//Plane[3] /= Area;
Plane[0]=plane.a;
Plane[1]=plane.b;
Plane[2]=plane.c;
Plane[3]=-plane.d;
Apologize for use DirectX, simply got accustomed to him. :)
Sincerely yours,
-------------------
arcad
mailto:arcad at orion-mm.ru
More information about the ODE
mailing list