File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Game Development
Bookmark "Breaking ODEjava physics" Watch "Breaking ODEjava physics" New topic

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!

~Currently preparing for SCJP6
Martin Juranek

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

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:
subject: Breaking ODEjava physics
It's not a secret anymore!