Jump to content

Strange gravity behavior


Myjestic
 Share

Recommended Posts

Hi together.

I toke a look at David Rousset QR Maze and tried to understand how babylon.js works and tried to optimize some code.

I came across some strange behavior with the gravity property.

scene.enablePhysics(new BABYLON.Vector3(0, 0, 0));
scene.gravity = new BABYLON.Vector3(0, -0.8, 0);
scene.collisionsEnabled = true;

As you can see, the gravitiy in ground direction is set to -0.8.

If I walk through the maze gravity is working. I am on 55fps. If I look onto the ground and move backwards nothing happens. So it should be,

I am working on a laptop and can switch it to low power consumption. The CPU and GPU than works on less power.

The frame rate drops to 25 fps.

Now if I do the some like mentioned above (looking down and walking back) and I am flying away from the ground.

 

The question is, why low fps affects the gravity of the scene?

If I set the gravity to -10 everthing is okay on both fps situations.

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...