readLinearVelocity
readLinearVelocity(
world,entity):Readonly<Vector3>
entity’s velocity in metres a second, written into one vector reused
by every call: copy it to keep it. Rapier’s on the world that simulates
the body, and the stream’s on a page for a body the room simulates;
zero for a fixed body and one not stepped yet.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
world |
World |
entity |
Entity |
Returns
Section titled “Returns”Readonly<Vector3>
Example
Section titled “Example”const speed = readLinearVelocity(world, ball).length();