Frame rate independent movement doesn't work?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Frame rate independent movement doesn't work?

Post by serengeor »

If the camera is a parent of the character node it's position wouldn't affect the camera position. So the gravity wouldn't do anything to it, because children don't affect parents.

You could try making camera a child of your character, though that may not give you the effect you wan't.
Working on game: Marrbles (Currently stopped).
diho
Posts: 46
Joined: Fri May 20, 2011 9:01 pm
Location: Netherlands

Re: Frame rate independent movement doesn't work?

Post by diho »

Yes, and then I should edit the event handler because of rotation and movement etc because the fpscam won't react at the mouse.
But I still don't get it. If the camera isn't effected by the gravity. Why is there a max jump height then (eventhought it's not the same on every pc). In my point of view it would only get higher and higer then :/
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Frame rate independent movement doesn't work?

Post by serengeor »

Well, yeah. I can't really find a reason right now why it has a max height.
But anyways, how you want to make the player jump looks not right to me.
What you should do is make the physics body jump and make the camera follow it, not the other way around.
Working on game: Marrbles (Currently stopped).
diho
Posts: 46
Joined: Fri May 20, 2011 9:01 pm
Location: Netherlands

Re: Frame rate independent movement doesn't work?

Post by diho »

Yes, I know cause then it will be effected by the gravity. But the character model isn't done yet ( someone is modelling it for me). And till that time I wanted to use just a camera. But the SKeyMap gave me that problem with different max jump heights.. So i tried it with the solution I found somewhere on this forum (the code in my first post of this topic). But it has the same effect, no difference rly. :/

But now I should make the character react at the movement of my mouse (rotation)
and then something like bindTargetAndRotation for the camera?

But anway, I was just wanting to make this code work till the character was done xD.

Diho
Reiko
Posts: 105
Joined: Sun Aug 16, 2009 7:06 am
Location: Australia

Re: Frame rate independent movement doesn't work?

Post by Reiko »

For frame rate independent movement, you are doing it right. That is, getting the time since the last frame and multiplying it by the amount to move.

So the problem is probably with your physics I suppose.

Also, if you are waiting for a character to be modelled, you could just use something as a place holder in the mean time, like a cube or whatever.
diho
Posts: 46
Joined: Fri May 20, 2011 9:01 pm
Location: Netherlands

Re: Frame rate independent movement doesn't work?

Post by diho »

Indeed, I know. But it's still weird it can't be done with just a camera. :(
But like you said I will try it with just a basic cube.

Diho
Post Reply