shovemedia
Senior Newbie 
|
 |
«
Posted
2004-07-15 18:59:39 » |
|
resetRotationAndForces mostly never works.
setting a body to a known position, orientation, etc ought to be pretty elementary operation. Why does the simulation blow up half the time? workarounds?
my car sim allows the car to flip over, so i'm implementing a reset button ...
:j
|
|
|
|
William Denniss
|
 |
«
Reply #1 - Posted
2004-07-15 21:39:57 » |
|
the car demo manages this without everything blowing up - are you calling resetRotationAndForces after moving them into position? Just make sure the order you are calling things is correct (use the car demo as a reference).
This is probably a good question for the ODE mailing list if you still have troubles as they are the ODE experts and they would be able to answer this question for sure. Just don't tell them java methods - open the source and see what ODE methods are actually being called and tell them those. I would like to add a debug log option which basically logs all calls to ODE.
Will.
|
|
|
|
shovemedia
Senior Newbie 
|
 |
«
Reply #2 - Posted
2004-07-16 13:18:44 » |
|
the car demo basically destroys all the joints and rebuilds the car from scratch. I see why this is effective now. Moving the chassis and expecting the wheels to snap into place probably creates crazy momentums and accelerations. I wonder if I can get away with moving the wheels but leaving the joints alone ...
I don't supppose Ode has a notion of "body groups" which would allow multiple arbitrary bodies to be positioned and rotated as a group?
thanks, :j
|
|
|
|
Games published by our own members! Check 'em out!
|
|
William Denniss
|
 |
«
Reply #3 - Posted
2004-07-16 21:38:22 » |
|
not sure I follow your "body groups" suggestion, can you elaborate please?
Will.
|
|
|
|
shovemedia
Senior Newbie 
|
 |
«
Reply #4 - Posted
2004-07-20 12:53:27 » |
|
"body groups" would be a collection of bodies joined by joints. My guess above proved correct, i needed to move both the chassis *and* the four wheels.
|
|
|
|
Vikstar
Senior Newbie 
|
 |
«
Reply #5 - Posted
2004-08-20 23:33:31 » |
|
Another approach you could use instead of reseting the car, is to analyse its position and orientation and apply forces to "float" it back to the reset position and orientation (obviously must step the world during this). Probably easier to turn off gravity and most collisions as well. I guess you could think of it like a more complex kind of ERP.
|
|
|
|
|