Joint2D¶
Box2D joint constraint.
Methods¶
| Name | Languages |
|---|---|
setDistanceJoint |
C++ | Lua |
setRevoluteJoint |
C++ | Lua |
setPrismaticJoint |
C++ | Lua |
setMouseJoint |
C++ | Lua |
setWheelJoint |
C++ | Lua |
setWeldJoint |
C++ | Lua |
setMotorJoint |
C++ | Lua |
getType |
C++ | Lua |
Method details¶
setDistanceJoint¶
void setDistanceJoint(Entity bodyA, Entity bodyB)void setDistanceJoint(Entity bodyA, Entity bodyB, Vector2 worldAnchorOnBodyA, Vector2 worldAnchorOnBodyB, bool rope)
Keeps two bodies at the distance their anchors have when the joint is created. The first form anchors at each body's position, the second takes anchors in world space. With rope set to true the joint acts like a rope: the bodies can move closer, but never farther apart than that distance. This is the Rope option of a Distance joint in the editor.