lovr.physics.newConeJoint
EditCreates a new ConeJoint.
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 joint anchor point, in world space. |
y | number | The y position of the joint anchor point, in world space. |
z | number | The z position of the joint anchor point, in world space. |
ax | number | The x component of the cone axis, in world space. |
ay | number | The y component of the cone axis, in world space. |
az | number | The z component of the cone axis, in world space. |
Returns
Name | Type | Description |
cone | ConeJoint | The new ConeJoint. |
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 joint anchor point, in world space. |
axis | Vec3 | The cone axis, in world space. |
Returns
Name | Type | Description |
cone | ConeJoint | The new ConeJoint. |
Notes
A ConeJoint is similar to a BallJoint, where the relative position between the colliders will be constrained to a single point. However, the ConeJoint also limits the rotation away from the cone axis. This can be useful for limb joints, ropes, etc.
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.