applyImpulse()
ecs.physics.applyImpulse(world, eid, impulseX, impulseY, impulseZ)
Description
This function is used to apply a one-time instantaneous force to a physics collider, altering its velocity based on the given impulse vector. This method is useful for events that require a quick, single action response, such as jumping, punching, or a sudden push.
Parameters
Parameter | Type | Description |
---|---|---|
world | number | World |
eid | Eid | Entity id |
impulseX | number | impulseX |
impulseY | number | impulseY |
impulseZ | number | impulseZ |
Returns
None.