applyImpulse(impulse, worldX, worldY)
Apply impulse to a point relative to the body.
This could for example be a point on the Body surface. An impulse is a force added to a body during a short
period of time (impulse = force * time). Impulses will be added to Body.velocity and Body.angularVelocity.
Parameters
Name | Type | Description |
---|---|---|
impulse | Float32Array | Array | The impulse vector to add, oriented in world space. |
worldX | number | A point relative to the body in world space. If not given, it is set to zero and all of the impulse will be exerted on the center of mass. |
worldY | number | A point relative to the body in world space. If not given, it is set to zero and all of the impulse will be exerted on the center of mass. |
- Source code: physics/p2/Body.js (Line 528)
Please login to continue.