[ODE] ODE feature - mass at (0,0,0) - related problem

Jon Watte (ODE) hplus-ode at mindcontrol.org
Mon Aug 22 14:21:27 MST 2005


You only want to use a dGeomTransform when your mass doesn't coincide 
with your collision. In this case, the mass and the collision coincide, 
so no dGeomTransform. Instead, you have to apply a transform between the 
piece of code that believes cubes are centered at (1,1,0) and the code 
that talks to ODE. Remember to take rotation into account!

Cheers,

			/ h+


paulo.jnkml at iol.pt wrote:
> Greetings
> My problem is the folowing:
> Suppose I have a cube (a box geom) with side 1 and center at (1,1,0). (and I can't change that)
> Though the cube has center at (1,1,0) it's position is (0,0,0). In other words the actual vertices were drawn centered at the cubes center but the model that moves those vertices in the world has position (0,0,0).
> Now, I tried to use a GeomTransform to encapsulate that cube and collision wise that works perfectly.
> The problem arises when the geom lands on the ground or some other object.
> It balances itself on the edge that goes from vertex (0.5,0.5,0.5) to (0.5,0.5,0.5). (of course not in that position in space)
> Let me make a sketch:
> 
>             |    ___box
>             |    |            |
>             |    | (1,1,0)|
>             |    |_____ |
> _____ |_________
>             |
>             |
> 
> Landed
>             |   
>             |       /  \         
>             |     /      \
>             |     \     /
> _____ |___\ /_____
>             |
>             |
> 
> Errr... I hope this is enough to get the picture. =)
> Well I can imagine this is because the center of mass is at (0,0,0) so the body just balances arround that edge pulled down by it's center of mass.
> I tried to translate the mass to the center of the geom but it must be at (0,0,0) when binding to a body so I don't know what to do...
> Someone has any idea or a reference to point me on this subject? (I'm sure somebody asked the same question some time before)
> 
> Thanks in advance.
> Best regards to all.
> Paulo
> PS: that is some bad ASCII art :p
> 
> ______________________________________________________________
> Possui Casa Propria ou um Credito a Habitacao e ainda tem que pagar outros emprestimos a varias instituicoes de credito? Reduza os seus encargos mensais ate 40%.
> Saber mais em http://www.iol.pt/correio/rodape.php?dst=0505301
> 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
> 
> 


More information about the ODE mailing list