# some ODE questions

This topic is 3633 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I only recently started using ODE (with tao/c#) so some of these questions might have a obvious answer, Can anyone explain to me how contact points work, why does a box on box collision always give four even if only the corner is touching? If I only use ODE for collision detection and not the physics part is there a way I can use the information in the contact points to make it so a falling object will land on the ground and not hover over it becouse the distance between it and the ground is less than the distance I step it down per frame. Is their a way you can group static map features so they wont generate collisions with each other or am i suppose to manually filter them out between dSpaceCollide and dCollide? (i don't care if a rock is touching the ground but im not sure how to separate them without leaving gaps) Is there a way to test for collisions on a single object? Is their a better way to make a height map or a wedge than using a trimesh?

##### Share on other sites
Quote:
 Original post by KazeI only recently started using ODE (with tao/c#) so some of these questions might have a obvious answer,Can anyone explain to me how contact points work, why does a box on box collision always give four even if only the corner is touching?

whenever an object intersects another, several contact points are generated. You can then create a conntact joint, which ODE uses to resolve collisions. I'm not sure why you always get 4 contacts. What parameter do you have for max contacts?
Quote:
 If I only use ODE for collision detection and not the physics part is there a way I can use the information in the contact points to make it so a falling object will land on the ground and not hover over it becouse the distance between it and the ground is less than the distance I step it down per frame.

yes but its easier to leave that to ODE. you would need to know a bit about physics simulations.
Quote:
 Is their a way you can group static map features so they wont generate collisions with each other or am i suppose to manually filter them out between dSpaceCollide and dCollide?

Yes, create a geometry and place it, but don't create a body, thusly: (c+ code)

    //create the box that things sit on    dGeomID box = dCreateBox(spaceID,100,10,100);    dGeomSetPosition (box, 0, -5 - (0.5 * cube_y), 0);			    //create plane to catch objects falling off the box	    dCreatePlane(spaceID,0,1,0,-20);

This is useful for level geometry and height maps.

Quote:
 (i don't care if a rock is touching the ground but im not sure how to separate them without leaving gaps)Is there a way to test for collisions on a single object?

yes, use the collision API, as detailed in the ODE user guide Which is pretty invaluable to me at least.
Quote:
 Is their a better way to make a height map or a wedge than using a trimesh?

I don' t think so. Look in the manual for any possible objects for this purpose, but ODE is limited to a few objects, excluding a height map.

##### Share on other sites
You can group objects in spaces and then check for collisions between spaces. In most collision libraries, you can check for collisions between all objects within a group, and you can check for collisions between objects in two different groups. ODE has this functionality.

You can also expand ODE with your own collision routines to handle more shapes, but you'd have to code them yourself.

##### Share on other sites
ok, thanks
i'l try some of the advice here

Quote:
 Original post by gb_programmerwhenever an object intersects another, several contact points are generated. You can then create a conntact joint, which ODE uses to resolve collisions. I'm not sure why you always get 4 contacts. What parameter do you have for max contacts?

if you mean when i call dCollide i set it hight to make sure i get all the contacts points available

Quote:
 Original post by VorpyYou can group objects in spaces and then check for collisions between spaces

so if two spaces were compared any touching objects within the same space would be ignored?

just a one more question,
for a trimesh is it better practice to create one huge mesh for the ground or divide it up into smaller parts

EDIT:

just incase i wasn't clear in the first post i want to avoid wasting processing power on immovable/static map features such as trees, statues or rocks sunk into the terrain touching each other but still have sprites collide with map features and sprites collide with sprites

##### Share on other sites
Quote:
 Original post by VorpyYou can group objects in spaces and then check for collisions between spaces. In most collision libraries, you can check for collisions between all objects within a group, and you can check for collisions between objects in two different groups. ODE has this functionality.You can also expand ODE with your own collision routines to handle more shapes, but you'd have to code them yourself.

I'm currently using this method for ray casting, where each ray is placed in a space, and collided with the spaces for other game entities, such as the space for characters. Just use dSpaceCollide2 to test two spaces against each other:

http://www.ode.org/ode-latest-userguide.html#func_dSpaceCollide2

For me, it was a bit of a struggle to get an ODE application working but once I did, it was just a case of learning one piece of functionality at a time and adding it to the test application.

##### Share on other sites
Quote:
 Is their a better way to make a height map or a wedge than using a trimesh?

ODE has had support for height fields since about v0.7, it's up to v0.9 now although you may need to get the very latest SVN snapshot to obtain the latest patched implementation. Anyway, check out "demo_heightfield".

edit: here on the wiki is a list of supported primitive types. As you can see ODE's main weakness is lack of solid convex support - but a trimesh will usually suffice as a substitute.

##### Share on other sites
unfortunately it looks like tao.ode only supports v0.6

##### Share on other sites

This topic is 3633 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.