Question about velocity

Hey there!
I have used three.js and cannon,js earlier, and have used the velocity property for bodies to move any “bullets” around my scene. I’m not sure how to do so in BJS, I don’t want to do a += for the position as I have a direction from a raycast and I would like the bullet to go in that direction. Is there any other workaround to the velocity thing (if velocity isn’t there in BJS). I am a beginner, so I don’t have any idea how am I supposed to do this!

BTW I referred this topic too: Question about mesh movement

Please let me know if you require more details!

Thanks for reading through! Thanks in advance too!

Pinging @Cedric


Linear and angular velocities are supported in BJS. Linear velocity describes the change of position over time. Angular velocity describes orientation over time.

As an example, this PG shows a sphere that rolls using setAngularVelocity.

setAngularVelocity(new Ammo.btVector3(0., 0., 0.))

will stop the object spinning just as

setLinerVelocity(new Ammo.btVector3(0., 0., 0.))

will stop the object.

Thanks a lot @Cedric !

1 Like