Sign in to follow this  
Andrey Zimin

Speed zero

Recommended Posts

Hi friends! There is a method setLinearVelocity() it sets the linear velocity vector. How to make the speed zero? Vector BABYLON.Vector3.Zero() in my opinion there not fit! And also about setAngularVelocity()! How does the rotation speed make zero?

Share this post


Link to post
Share on other sites

Both methods take the same parameters. You can always verify by looking at the class documentation:
https://doc.babylonjs.com/classes/3.1/physicsimpostor#setangularvelocity-velocity-rarr-void

mesh.physicsImpostor.setLinearVelocity(BABYLON.Vector3.Zero());
mesh.physicsImpostor.setAngularVelocity(BABYLON.Vector3.Zero());

That should remove linear and rotational movement.  If you don't have any joints you could try a forceUpdate(), but I have not found that necessary myself.  Otherwise you can sleep() and wakeUp() the physics impostor, but then it loses physics properties.  If that code doesn't work then can you reproduce in a PG?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.