[ODE] newby: collision detection with ODE and my triangle mesh

trapni at surakware.net trapni at surakware.net
Mon Apr 5 07:19:39 MST 2004


Hi all,

I'm highly new to ODE, and as I was just looking on how to
implement collision detection for my rendering engine, I
came to ODE that even even supports this as a side-affect
feature ;)

However, I've no clue yet how to add my triangle mesh into the
space of ODE. My scene is built in a hierarchy, so doing this
with the spaces in ODE is even possible, too. But now, how do
I add my final leaf nodes to ODE that are (actually) just a set
of triangles (everything is made in tris ATM).

// create my world root nodes for ODE
dWorldID worldId = dWorldCreate();
dSpaceID rootSpace = dCreateHashSpace(0);

// create my foo-object sub-space for ODE
dSpaceID fooSpace = dCreateHashSpace(0);
dSpaceAdd(rootSpace, fooSpace);

but how do I now add a non-trivial-geometric object into my fooSpace,
that is, not just a sphere/capsule/box/cylinder/plane/bar?

Imagine a pyramid, that can't be described by one of the objects above.
How do I add such a pyramid with the coordinates:
	[1,0,0] [0,0,0] [0,0,1] [1,0,1] [1/2, 1, 1/2]
(with z=up)?

Many thanks,
Christian Parpart.


More information about the ODE mailing list