applyTorque()
ecs.physics.applyTorque(world, eid, torqueX, torqueY, torqueZ)
Description
You can directly apply forces (linear and angular) to any entity with a physics collider. These forces are applied in the next physics simulation update, which takes place at regular intervals. The function accepts a 3D vector to define the force direction and magnitude.
Note: This is dependent on the frequency of calls to requestAnimationFrame()
or your devices refresh rate.
Parameters
Parameter | Type | Description |
---|---|---|
world | number | World |
eid | Eid | Entity id |
torqueX | number | torqueX |
torqueY | number | torqueY |
torqueZ | number | torqueZ |
Returns
None.