Multiple Geoms for the Same Body [JOODE]

Hi everyone,

this day I’ve been working hard on XPAL (Xith3D Physics Abstraction Layer, for those who don’t follow) and I came accross the problem of having a Body with multiple shapes.
As I see it, it could be done in several ways (classified in order of increasing coolness) :

  • I remember there was a fixed Joint in ODE but that would require multiple bodies, would be needlessly slow, and probably unstable.
  • By hand, the Body refers to nothing, and the users just detect collisions for the Geoms he wants, then update the pos/rot of the Geoms from the pos/rot of the Body
  • By having a list of Geoms referred in Body instead of just one. But that would require that the Geom have two position/rotation : one position/rotation relative to the body (which doesn’t change with stepping), and another absolute (world coordinate, is updated each step with the Body’s own position/rotation)
  • By simply using a Space, but that would also require that the Geom have two position/rotation (relative to Space pos/rot, and world coord).

The solution I prefer is the last one (Space), but it needs changes in JOODE to be implemented.

So, JOODE devs (thomas, arne, …) what do you think about that ?

[quote]- By having a list of Geoms referred in Body instead of just one. But that would require that the Geom have two position/rotation : one position/rotation relative to the body (which doesn’t change with stepping), and another absolute (world coordinate, is updated each step with the Body’s own position/rotation)
[/quote]
that sounds like GeomTransform. But I don’t know, if it works already.

[quote]By simply using a Space, but that would also require that the Geom have two position/rotation (relative to Space pos/rot, and world coord).
[/quote]
I don’t follow you. The class Space groups geoms, that can collide with each other, so how do you want to force fixed positions into there?

I think using GeomTransform is the easiest way, because it’s not as trivial as it first looks to have several geoms in one body, because the problem the solver has to solve gets modified.

Ah yeah, forgot that.

Yeah, you’re right. So that’s a bad idea.

Well, I don’t see it as a more difficult problem for the solver because the solver doesn’t know from which geom the contact joint comes (IIRC), so if contact points come from one geom or several shouldn’t make a too big difference.

right, so GeomTransform should be fairly understandable (and fixable, if it doesn’t run :wink: ) - ohh and we should add a test in Space, that Geoms belonging to the same Body cannot collide.

Oh yeah. GeomTransform is the way to go…

[quote]and fixable, if it doesn’t run
[/quote]
I have used it ow and it worked fine, including the collider. I added support in the XithConverter

Arne, you seem to have an intuatition with matrix transformation etc. I wonder if you could improve the GeomTransform class (or create a v2 one) that runs off a 4x4 matrix? It would be good if Geoms could be deliberatly rescaled as well as rotated and translated, thus we would have support for elispses and rhomboids etc.