A ragdoll joint is designed to simulate ragdoll's limbs. It constrains swing and twist angles between two rigid bodies. The two rigid bodies have constraint axes, and the swing angle is defined by the angle of two constraint axes, while the twist angle is defined by the rotation angle along the two axes. In addition to lower and upper limits of the twist angle, You can set an "elliptic cone limit" of the swing angle by specifying two swing axes (though one of them is automatically computed) and corresponding maximum swing angles. You can also enable a motor of the twist part of the constraint, spring and damper effect of the both swing and twist part of the constraint.

Constructor

new(config:RagdollJointConfig)

Creates a new ragdoll joint by configuration config.

Methods

inlinegetAxis1():Vec3

Returns the first rigid body's constraint axis in world coordinates.

inlinegetAxis1To(axis:Vec3):Void

Sets axis to the first rigid body's constraint axis in world coordinates.

This does not create a new instance of Vec3.

inlinegetAxis2():Vec3

Returns the second rigid body's constraint axis in world coordinates.

inlinegetAxis2To(axis:Vec3):Void

Sets axis to the second rigid body's constraint axis in world coordinates.

This does not create a new instance of Vec3.

inlinegetLocalAxis1():Vec3

Returns the first rigid body's constraint axis relative to the rigid body's transform.

inlinegetLocalAxis1To(axis:Vec3):Void

Sets axis to the first rigid body's constraint axis relative to the rigid body's transform.

This does not create a new instance of Vec3.

inlinegetLocalAxis2():Vec3

Returns the second rigid body's constraint axis relative to the rigid body's transform.

inlinegetLocalAxis2To(axis:Vec3):Void

Sets axis to the second rigid body's constraint axis relative to the rigid body's transform.

This does not create a new instance of Vec3.

inlinegetSwingAngle():Float

Returns the swing angle in radians.

inlinegetSwingAxis():Vec3

Returns the swing axis in world coordinates.

inlinegetSwingAxisTo(axis:Vec3):Void

Sets axis to the swing axis in world coordinates.

This does not create a new instance of Vec3.

inlinegetSwingSpringDamper():SpringDamper

Returns the rotational spring and damper settings along the swing axis.

inlinegetTwistAngle():Float

Returns the twist angle in radians.

inlinegetTwistLimitMotor():RotationalLimitMotor

Returns the rotational limits and motor settings along the twist axis.

inlinegetTwistSpringDamper():SpringDamper

Returns the rotational spring and damper settings along the twist axis.

Inherited Variables

Defined by Joint

userData:Any

Extra field that users can use for their own purposes.

Inherited Methods

Defined by Joint

inlinegetAllowCollision():Bool

Returns whether to allow the connected rigid bodies to collide each other.

inlinegetAnchor1():Vec3

Returns the first rigid body's anchor point in world coordinates.

inlinegetAnchor1To(anchor:Vec3):Void

Sets anchor to the first rigid body's anchor point in world coordinates.

This does not create a new instance of Vec3.

inlinegetAnchor2():Vec3

Returns the second rigid body's anchor point in world coordinates.

inlinegetAnchor2To(anchor:Vec3):Void

Sets anchor to the second rigid body's anchor point in world coordinates.

This does not create a new instance of Vec3.

inlinegetAppliedForce():Vec3

Returns the force applied to the first rigid body at the last time step.

inlinegetAppliedForceTo(appliedForce:Vec3):Void

Sets appliedForce to the force applied to the first rigid body at the last time step.

This does not create a new instance of Vec3.

inlinegetAppliedTorque():Vec3

Returns the torque applied to the first rigid body at the last time step.

inlinegetAppliedTorqueTo(appliedTorque:Vec3):Void

Sets appliedTorque to the torque applied to the first rigid body at the last time step.

This does not create a new instance of Vec3.

inlinegetBasis1():Mat3

Returns the basis of the joint for the first rigid body in world coordinates.

inlinegetBasis1To(basis:Mat3):Void

Sets basis to the basis of the joint for the first rigid body in world coordinates.

This does not create a new instance of Mat3.

inlinegetBasis2():Mat3

Returns the basis of the joint for the second rigid body in world coordinates.

inlinegetBasis2To(basis:Mat3):Void

Sets basis to the basis of the joint for the second rigid body in world coordinates.

This does not create a new instance of Mat3.

inlinegetBreakForce():Float

Returns the magnitude of the constraint force at which the joint will be destroyed.

Returns 0 if the joint is unbreakable.

inlinegetBreakTorque():Float

Returns the magnitude of the constraint torque at which the joint will be destroyed.

Returns 0 if the joint is unbreakable.

inlinegetLocalAnchor1():Vec3

Returns the first rigid body's local anchor point in world coordinates.

inlinegetLocalAnchor1To(localAnchor:Vec3):Void

Sets localAnchor to the first rigid body's anchor point in local coordinates.

This does not create a new instance of Vec3.

inlinegetLocalAnchor2():Vec3

Returns the second rigid body's local anchor point in world coordinates.

inlinegetLocalAnchor2To(localAnchor:Vec3):Void

Sets localAnchor to the second rigid body's anchor point in local coordinates.

This does not create a new instance of Vec3.

inlinegetNext():Joint

Returns the next joint in the world.

If the next one does not exist, null will be returned.

inlinegetPositionCorrectionAlgorithm():Int

Returns the type of the position correction algorithm for the joint.

See PositionCorrectionAlgorithm for details.

inlinegetPrev():Joint

Returns the previous joint in the world.

If the previous one does not exist, null will be returned.

inlinegetRigidBody1():RigidBody

Returns the first rigid body.

inlinegetRigidBody2():RigidBody

Returns the second rigid body.

inlinegetType():Int

Returns the type of the joint.

See JointType for details.

inlinesetAllowCollision(allowCollision:Bool):Void

Sets whether to allow the connected rigid bodies to collide each other.

inlinesetBreakForce(breakForce:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetBreakTorque(breakTorque:Float):Void

Sets the magnitude of the constraint force at which the joint will be destroyed.

Set 0 for unbreakable joints.

inlinesetPositionCorrectionAlgorithm(positionCorrectionAlgorithm:Int):Void

Sets the type of the position correction algorithm to positionCorrectionAlgorithm for the joint.

See PositionCorrectionAlgorithm for details.