lovr.physics.newHingeJoint
EditCreates a new HingeJoint.
Arguments
Name | Type | Description |
colliderA | Collider |
The first collider to attach the Joint to, or nil to attach the joint to a fixed position in the World.
|
colliderB | Collider | The second collider to attach the Joint to. |
x | number | The x position of the hinge anchor, in world coordinates. |
y | number | The y position of the hinge anchor, in world coordinates. |
z | number | The z position of the hinge anchor, in world coordinates. |
ax | number | The x component of the hinge axis direction. |
ay | number | The y component of the hinge axis direction. |
az | number | The z component of the hinge axis direction. |
Returns
Name | Type | Description |
hinge | HingeJoint | The new HingeJoint. |
Arguments
Name | Type | Description |
colliderA | Collider |
The first collider to attach the Joint to, or nil to attach the joint to a fixed position in the World.
|
colliderB | Collider | The second collider to attach the Joint to. |
anchor | Vec3 | The anchor point, in world coordinates. |
axis | Vec3 | The hinge axis direction. |
Returns
Name | Type | Description |
hinge | HingeJoint | The new HingeJoint. |
Notes
A hinge joint constrains two colliders to allow rotation only around the hinge's axis.
If the anchor is nil, the position of the first Collider is the anchor. If the first Collider is nil, the position of the second collider is the anchor.
If the axis is nil, it defaults to the direction between the anchor and the second Collider.