sm.physics.applyImpulse
Applies an impulse to a Shape, changing its velocity immediately. The impulse is applied to the shape's centerpoint with an optional offset.
Kind: Function
Environments: Game
Game
Overload 1
sm.physics.applyImpulse( target, impulse, worldSpace, offset )
Parameters:
| Name | Type | Description |
|---|---|---|
target |
Shape | The object on which the impulse is exerted on. |
impulse |
Vec3 | The direction and strength of the impulse. |
worldSpace (optional) |
boolean | Whether the impulse is applied in world space coordinates. (Defaults to local rotation) |
offset (optional) |
Vec3 | The offset from the center point. (Defaults to no offset) |
Overload 2
sm.physics.applyImpulse( target, impulse, worldSpace, offset )
Applies an impulse to a Body, changing its velocity immediately. The impulse is applied to the body's center of mass with an optional offset.
Parameters:
| Name | Type | Description |
|---|---|---|
target |
Body | The object on which the impulse is exerted on. |
impulse |
Vec3 | The direction and strength of the impulse. |
worldSpace (optional) |
boolean | Whether the impulse is applied in world space coordinates. (Defaults to local rotation) |
offset (optional) |
Vec3 | The offset from the center point. (Defaults to no offset) |
Overload 3
sm.physics.applyImpulse( target, impulse )
Applies an impulse to a Character, changing its velocity immediately. The impulse is applied to the character's centerpoint.
Parameters: