Jump to content

Camera "Walking" Twitchy


reddozen
 Share

Recommended Posts

I've noticed that as the frame rate drops, that the FPS camera movement (walking) gets ridiculously twitchy. I'll tap the arrow key and it will rocket ahead by like 20,000 units...

 

Is there any way to address this situation so that the movement speed is is always predictable regardless of the frame rate?

Link to comment
Share on other sites

I'm afraid this is linked to the standard behavior of the camera.

In the freeCamera.js file, we have this function:

BABYLON.FreeCamera.prototype._computeLocalCameraSpeed = function () {        return this.speed * ((BABYLON.Tools.GetDeltaTime() / (BABYLON.Tools.GetFps() * 10.0)));    };

It defines the effective speed of the camera on every frame based on the current FPS to ensure that regardless of the computer power, the camera will move at a constant speed.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...