Closed Druidhawk closed 9 years ago
How are you setting the velocity? It should be something like
body.linear_velocity.set( 1, 2, 3 );
May I am incorrect in assuming that negative velocities move you backwards.
The velocity is always in world coordinates and not related to the object's rotation. Negative velocities will move an object along the negative direction of an XYZ coordinate.
I was hoping to use a physics shape to act as, say a missile. I am trying to manipulate the linear velocity of a physics shape, which has a associated threejs mesh, and move from threejs launcher towards another threejs shape. I wanted to use physics so the arc/curve of the missile track would account for mass etc. Unfortunately whenever I mess with linear velocity I end up with NAN. Since the target shape is moving, I reset linear velocity on the fly, this is a guided missile which tracks its target.
Any thoughts or opinions welcome. I got the idea of velocity from the mesh statue example where you shoot spheres out with a y velocity.
Alternately can I set some kind of attractive force between the missile and a target