Physics.P2.Body#addCircle()

addCircle(radius, offsetX, offsetY, rotation) → {p2.Circle}

Adds a Circle shape to this Body. You can control the offset from the center of the body and the rotation.

Parameters
Name Type Argument Default Description
radius number

The radius of this circle (in pixels)

offsetX number <optional>
0

Local horizontal offset of the shape relative to the body center of mass.

offsetY number <optional>
0

Local vertical offset of the shape relative to the body center of mass.

rotation number <optional>
0

Local rotation of the shape relative to the body center of mass, specified in radians.

Returns
p2.Circle -

The Circle shape that was added to the Body.

Source code: physics/p2/Body.js (Line 1017)
doc_phaser
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.