Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!

Breaking ODEjava physics

Brian Legg
Ranch Hand
Posts: 488
ODE is being used to manage the physics in my new game/environment. What I can't figure out is if there is a way to temporarily break the laws of physics, but only for certain cases.

For instance I'd like my character to be able to jump against a 100% vertical wall and then leap off of it onto a nearby wall, then leap off that wall, etc. I don't want gravity to disappear as the character would just float away, and I still need friction, velocity, etc... but when he leaps off the wall I'd like gravity to be severly reduced (so he jumps higher.... think crouching tiger hidden dragon) without causing a moon gravity experience where the user goes higher but moves more slowly.

Any help is appreciated if anyone has any ODE experience.

ps: ODEjava is just the java implementation of ODE, they are the same thing.

Martin Juranek
Greenhorn
Posts: 2
I don't know ODE, so I'm free to speculate
Is it possible to temporarily reduce mass of object? (So it will be less affected by gravity)
Would it be then more affected by air friction? If yes, can you compute how would smaller object behave (less air friction) and update state of full sized one besed on this?

Sean Collins
Greenhorn
Posts: 8
I keep meaning to use ODE in one of my own projects, never got past J3D and nasty hacks! I think if you're going to break the laws of physics, your game is going to end up looking like SuperMario, isn't it? Wouldn't it be better to break the laws of leg forces? I think ODE has friction in it, why not just allow your character to exert a few tens of thousands of Newtons force with its legs, and that should get you what you're looking for. Come to think of it, no it wouldn't. Your character wouldn't need to use the wall in that case, they could just launch from the floor. If there's a way of setting very high friction on the walls, perhaps there's no need for extra force at all - is there?

The only other thing I could think of - if it's possible - is to check for a sufficiently 'hard' foot / wall collision and make a temporary joint at that point. That might get you something like you're looking for. If it's a timed joint, failing to jump again quickly enough would have you fall to the floor, rather than scrape slowly down the wall like high friction might give you.