Table of Contents

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

world World
body1 RigidBody
body2 RigidBody
hingeCenter JVector
hingeAxis JVector
angle AngularLimit
drive JointDrive

The optional drive. Motor and servo torque default to zero.

Exceptions

ArgumentOutOfRangeException

The drive selection is invalid.

ArgumentException

Thrown when hingeCenter contains a non-finite value, when hingeAxis is zero or contains a non-finite value, when either body does not belong to world, 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

world World
body1 RigidBody
body2 RigidBody
hingeCenter JVector
hingeAxis JVector
angle AngularLimit
hasMotor bool

Exceptions

ArgumentOutOfRangeException

The drive selection is invalid.

ArgumentException

Thrown when hingeCenter contains a non-finite value, when hingeAxis is zero or contains a non-finite value, when either body does not belong to world, 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

world World
body1 RigidBody
body2 RigidBody
hingeCenter JVector
hingeAxis JVector
drive JointDrive

The optional drive. Motor and servo torque default to zero.

Exceptions

ArgumentOutOfRangeException

The drive selection is invalid.

ArgumentException

Thrown when hingeCenter contains a non-finite value, when hingeAxis is zero or contains a non-finite value, when either body does not belong to world, 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

world World
body1 RigidBody
body2 RigidBody
hingeCenter JVector
hingeAxis JVector
hasMotor bool

Exceptions

ArgumentOutOfRangeException

The drive selection is invalid.

ArgumentException

Thrown when hingeCenter contains a non-finite value, when hingeAxis is zero or contains a non-finite value, when either body does not belong to world, or when both body references are the same.

Properties

BallSocket

public BallSocket BallSocket { get; }

Property Value

BallSocket

Body1

public RigidBody Body1 { get; }

Property Value

RigidBody

Body2

public RigidBody Body2 { get; }

Property Value

RigidBody

HingeAngle

public HingeAngle HingeAngle { get; }

Property Value

HingeAngle

Motor

public AngularMotor? Motor { get; }

Property Value

AngularMotor

Servo

public TwistServo? Servo { get; }

Property Value

TwistServo