applyForce()
ecs.physics.applyForce(world, eid, forceX, forceY, forceZ)
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 |
forceX | number | forceX |
forceY | number | forceY |
forceZ | number | forceZ |
Returns
None.