This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Game Development and the fly likes Breaking ODEjava physics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Game Development
Bookmark "Breaking ODEjava physics" Watch "Breaking ODEjava physics" New topic
Author

Breaking ODEjava physics

Brian Legg
Ranch Hand

Joined: Nov 07, 2008
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.

Thanks in advance!

SCJA
~Currently preparing for SCJP6
Martin Juranek
Greenhorn

Joined: Nov 12, 2009
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

Joined: Nov 16, 2009
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Breaking ODEjava physics