[ODE] example for using trimesh landscapes

Duncan Frostick duncanf at f2s.com
Thu Oct 28 21:31:05 MST 2004


Hi, thanks for the for the reply, my MAX_CONTACTS is set to 1000! I set 
it that high to try to give the simulation the best chance possible of 
getting things right.

I'm initing ODE with the following:

world = dWorldCreate();
space = dSimpleSpaceCreate(0);
contactGroup = dJointGroupCreate(0);
jointGroup = dJointGroupCreate(0);

dWorldSetGravity(world,0,-1.0f,0);
dCreatePlane(space,0,1,0,0);

Thats all fine surely? The problem is best illustrated by dropping boxes 
on the floor plane, here's a screenshot of what the boxes look like at 
*rest* (and a copy of my ODE collision and init code) - notice the weird 
angles all but one are at:

http://www.duncanf.co.uk/~dunc/project/rest.png
http://www.duncanf.co.uk/~dunc/project/DuncEnginePhysics.cpp

Also, after the boxes seem to have come to a rest (collisions with the 
floor plane continue but that's normal right?) some will eventually 
decide to bounce upwards repeatedly and after a while they'll bounce out 
of view completely! And this is without setting any bounce collision 
parameters.

It's just completely unstable, and this isn't bringing trimeshes into it 
at all yet. Surely there's something basic I'm missing, but I can't see 
what, I'm doing exactly what the test code and other coders seem to be 
doing, it's very frustrating indeed!

Any ideas?

Cheers, Duncan



Megan Fox wrote:
> What is your MAX_CONTACTS set at?  Is it at least 24?
> 
> (trimesh geometry requires a LOT more contacts to be correct than
> normal geom-geom collisions)
> 
> 
> I admit I haven't tested this (still fiddling with my house geometry,
> haven't gotten to terrain), but it seems like you should be able to
> classify your geom types and only use the larger number of contacts
> for X-vs-trimesh collisions, rather than upping your MAX_CONTACTS to
> 24 for everything.  Not really important until you've got the basic
> setup working and are optimizing, though.
> 
> -Megan Fox
> 
> 
>>I've tried to replicate your ODE setup Tyler as much as I could see (Ode
>>init, collision settings... couldn't find mass and density settings of
>>bodies though). My problem is that nothing seems to collide in a natural
>>fashion, and when they do most of the time they bounce around
>>erratically and/or get embedded in each other. That's a really lame
>>description of the problem I know, so if you want a look at what I mean
>>here's a (Win32 DirectX SDK built... sorry!) binary:



More information about the ODE mailing list