Physics.P2.Body#applyImpulse()

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)
doc_phaser
2017-02-14 11:01:52
Comments
Leave a Comment

Please login to continue.