static jumpheight?

rewb0rn

17-01-2007 15:35:32

Hi

I implemented the walking character from the ode tutorials and added a jump method. The problem is, that every time I jump the player reaches different heights, but I want it to be always the same height, so that the player knows what he can jump on and what not and so on.

It seems to be a problem with ode, that the velocity and force are computed different every time, because I only allow the player to jump if he is in contact with the floor and in addition all y force and y velocity is set to 0 before the jumpforce is added. Still there are big differences. Does some1 know how to make a body always jump the same?

termit7577

27-01-2007 13:56:05

I personally use one of the two methods in such situations:
1) instead of a push force, throwing the object up, just translate it up (setPostiotion to a fixed height) and then simulate physics again and let it drop.
2)let it be as is, since this brings much more realist into the game, as in real world, we never know how high our next jump is going to be. 8)

rewb0rn

08-02-2007 23:09:29

i finally made it with framebased rendering instead of timebased rendering. to those who wish to use it paste this to your FrameTime Detection:

while (GetRoot()->getTimer()->getMilliseconds() < 20) Sleep(1);

TimePassed = double(GetRoot()->getTimer()->getMilliseconds()) / 1000.0;
GetRoot()->getTimer()->reset();

1000 ms / 20 = 50 fps in this case.