So what did you guys use for your
dWorldSetLinearDamping(World, 0.001);
dWorldSetAngularDamping(World, 0.005);
values. Also i found out that on DBO files, collision works for the ceiling and the floor, but not the walls. weird huh! UPDATE: Collision on walls does not work on ODE with .x files. Im exporting these files from 3d world studio.
UPDATE AGAIN!: Alright i figured out that collision works with everything on dbo files! The problem is that when i move the dynamic object(character controller), its moving so fast it just bursts right through the wall. Is there anyway at all to make the wall impenetrable at high speeds? At low speeds, just a balling bouncing in a tri-mesh room works, but if you speed up the object u can just burst right through the wall.
Thanks!
Also my nearcallaback and method of triangle mesh collision
//NearCallback for dSpaceCollide(collision)
void nearCallback( void *data, dGeomID o1, dGeomID o2 )
{
dBodyID b1 = dGeomGetBody(o1);
dBodyID b2 = dGeomGetBody(o2);
dContact contact;
//contact.surface.mode = dContactBounce | dContactSoftCFM;
//contact.surface.mode = 1
contact.surface.mode = dContactBounce;
// friction parameter
contact.surface.mu = dInfinity;
// bounce is the amount of "bouncyness".
contact.surface.bounce = 0.9f;
// bounce_vel is the minimum incoming velocity to cause a bounce
contact.surface.bounce_vel = 0.1f;
// constraint force mixing parameter
contact.surface.soft_cfm = 0.001f;
if (int numc = dCollide (o1,o2,1,&contact.geom,sizeof(dContact))) {
dJointID c = dJointCreateContact (World,ContactGroup,&contact);
dJointAttach (c,b1,b2);
//dBodySetLinearDamping(body,0.08);
}
}
Tri-mesh:
void CreateTriMesh( int object_id )
{
// create tri mesh from object mesh
int mesh = object_id;
dbMakeMeshFromObject( mesh, object_id );
dbLockVertexDataForMesh( mesh );
int vertexcount = dbGetVertexDataVertexCount(),
indexcount = dbGetVertexDataIndexCount();
// build structure for ode trimesh geom
dVector3 * vertices = new dVector3[vertexcount];
dTriIndex * indices = new dTriIndex[indexcount];
for ( int n = 0; n < indexcount; n++ )
{
indices[n] = dbGetIndexData( n );
}
for ( int n = 0; n < vertexcount; n++ )
{
vertices[n][0] = dbGetVertexDataPositionX( n );
vertices[n][1] = dbGetVertexDataPositionY( n );
vertices[n][2] = dbGetVertexDataPositionZ( n );
}
dbUnlockVertexData();
dbDeleteMesh( mesh );
// build the trimesh data
dTriMeshDataID data = dGeomTriMeshDataCreate();
dGeomTriMeshDataBuildSimple( data, (dReal*)vertices, vertexcount, indices, indexcount);
// create the geom
geom2 = dCreateTriMesh( space, data, 0, 0, 0 );
dGeomSetPosition(geom2,0,-50,20);
}
For the trimesh it creates a static one. Any help would be appreciated.