[ODE] ODE feature - mass at (0,0,0) - related problem
paulo.jnkml at iol.pt
paulo.jnkml at iol.pt
Tue Aug 23 04:58:12 MST 2005
Thank you very much Jon. Actualy that was what I was dooing before I thought that I could do the same with dGeomTransform. I was aplying the relative transformation of tha object to the geom and after the simulation step I just had to aply the inverse to get the position of the object in my world. Then I thought I had found the holy graal of geom transform.... Gess I was wrong... Well undo undo undo :p
Jon Watte ODE wrote:
>
> 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
>>
>>
_________________________________________________________________________________
Com o IOL Talki fale a 0 Euros!
CHAMADAS GRATIS atraves da Internet.
Saber mais em http://www.iol.pt/correio/rodape.php?dst=0508111
More information about the ODE
mailing list