#1346·matter-js

Body velocity documentation confusing

Author: RosuavCreated Jul 25, 2025Updated Jul 25, 2025

https://brm.io/matter-js/docs/classes/Body.html#property_velocity says that this is equivalent to the magnitude of angular velocity, which seems likely wrong?

Inspecting the source code leaves me somewhat confused as to the interaction of body.velocity, Body.getVelocity, and timescale. If you call setVelocity, body.velocity is set to the difference between prev and current positions, divided by timescale; but the getVelocity method returns the difference, multiplied by timescale. This would benefit from being elaborated on in the documentation.