Class HingeJoint
- Namespace
- Jitter2.Dynamics.Constraints
- Assembly
- Jitter2.dll
Constructs a hinge using a HingeAngle and a BallSocket, with an optional AngularMotor or TwistServo.
public class HingeJoint : Joint, IDebugDrawable
- Inheritance
-
HingeJoint
- Implements
- Inherited Members
Constructors
HingeJoint(World, RigidBody, RigidBody, JVector, JVector, AngularLimit, JointDrive)
Initializes a new hinge joint.
public HingeJoint(World world, RigidBody body1, RigidBody body2, JVector hingeCenter, JVector hingeAxis, AngularLimit angle, JointDrive drive = JointDrive.None)
Parameters
worldWorldbody1RigidBodybody2RigidBodyhingeCenterJVectorhingeAxisJVectorangleAngularLimitdriveJointDriveThe optional drive. Motor and servo torque default to zero.
Exceptions
- ArgumentOutOfRangeException
The drive selection is invalid.
- ArgumentException
Thrown when
hingeCentercontains a non-finite value, whenhingeAxisis zero or contains a non-finite value, when either body does not belong toworld, or when both body references are the same.
HingeJoint(World, RigidBody, RigidBody, JVector, JVector, AngularLimit, bool)
Initializes a new hinge joint.
[Obsolete("Use the overload accepting JointDrive instead of hasMotor.")]
public HingeJoint(World world, RigidBody body1, RigidBody body2, JVector hingeCenter, JVector hingeAxis, AngularLimit angle, bool hasMotor)
Parameters
worldWorldbody1RigidBodybody2RigidBodyhingeCenterJVectorhingeAxisJVectorangleAngularLimithasMotorbool
Exceptions
- ArgumentOutOfRangeException
The drive selection is invalid.
- ArgumentException
Thrown when
hingeCentercontains a non-finite value, whenhingeAxisis zero or contains a non-finite value, when either body does not belong toworld, or when both body references are the same.
HingeJoint(World, RigidBody, RigidBody, JVector, JVector, JointDrive)
Initializes a new hinge joint.
public HingeJoint(World world, RigidBody body1, RigidBody body2, JVector hingeCenter, JVector hingeAxis, JointDrive drive = JointDrive.None)
Parameters
worldWorldbody1RigidBodybody2RigidBodyhingeCenterJVectorhingeAxisJVectordriveJointDriveThe optional drive. Motor and servo torque default to zero.
Exceptions
- ArgumentOutOfRangeException
The drive selection is invalid.
- ArgumentException
Thrown when
hingeCentercontains a non-finite value, whenhingeAxisis zero or contains a non-finite value, when either body does not belong toworld, or when both body references are the same.
HingeJoint(World, RigidBody, RigidBody, JVector, JVector, bool)
Initializes a new hinge joint.
[Obsolete("Use the overload accepting JointDrive instead of hasMotor.")]
public HingeJoint(World world, RigidBody body1, RigidBody body2, JVector hingeCenter, JVector hingeAxis, bool hasMotor)
Parameters
Exceptions
- ArgumentOutOfRangeException
The drive selection is invalid.
- ArgumentException
Thrown when
hingeCentercontains a non-finite value, whenhingeAxisis zero or contains a non-finite value, when either body does not belong toworld, or when both body references are the same.
Properties
BallSocket
public BallSocket BallSocket { get; }
Property Value
Body1
public RigidBody Body1 { get; }
Property Value
Body2
public RigidBody Body2 { get; }
Property Value
HingeAngle
public HingeAngle HingeAngle { get; }
Property Value
Motor
public AngularMotor? Motor { get; }
Property Value
Servo
public TwistServo? Servo { get; }