Table of Contents

Class PrismaticJoint

Namespace
Jitter2.Dynamics.Constraints
Assembly
Jitter2.dll

Constructs a prismatic joint using a PointOnLine constraint, either a FixedAngle or HingeAngle constraint, and an optional LinearMotor or LinearAxisServo drive.

public class PrismaticJoint : Joint, IDebugDrawable
Inheritance
PrismaticJoint
Implements
Inherited Members

Constructors

PrismaticJoint(World, RigidBody, RigidBody, JVector, JVector)

Initializes a new prismatic joint.

public PrismaticJoint(World world, RigidBody body1, RigidBody body2, JVector center, JVector axis)

Parameters

world World

The world containing both bodies.

body1 RigidBody

The first body.

body2 RigidBody

The second body.

center JVector

The joint center in world space.

axis JVector

The sliding axis in world space.

Exceptions

ArgumentOutOfRangeException

The drive selection is invalid.

ArgumentException

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

PrismaticJoint(World, RigidBody, RigidBody, JVector, JVector, JointDrive, bool)

Initializes a new prismatic joint.

public PrismaticJoint(World world, RigidBody body1, RigidBody body2, JVector center, JVector axis, JointDrive drive, bool pinned = true)

Parameters

world World

The world containing both bodies.

body1 RigidBody

The first body.

body2 RigidBody

The second body.

center JVector

The joint center in world space.

axis JVector

The sliding axis in world space.

drive JointDrive

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

pinned bool

If true, lock relative rotation with FixedAngle; otherwise constrain it with HingeAngle.

Exceptions

ArgumentOutOfRangeException

The drive selection is invalid.

ArgumentException

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

PrismaticJoint(World, RigidBody, RigidBody, JVector, JVector, LinearLimit)

Initializes a new prismatic joint.

public PrismaticJoint(World world, RigidBody body1, RigidBody body2, JVector center, JVector axis, LinearLimit limit)

Parameters

world World

The world containing both bodies.

body1 RigidBody

The first body.

body2 RigidBody

The second body.

center JVector

The joint center in world space.

axis JVector

The sliding axis in world space.

limit LinearLimit

Allowed displacement along the sliding axis.

Exceptions

ArgumentOutOfRangeException

The drive selection is invalid.

ArgumentException

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

PrismaticJoint(World, RigidBody, RigidBody, JVector, JVector, LinearLimit, JointDrive, bool)

Initializes a new prismatic joint.

public PrismaticJoint(World world, RigidBody body1, RigidBody body2, JVector center, JVector axis, LinearLimit limit, JointDrive drive, bool pinned = true)

Parameters

world World

The world containing both bodies.

body1 RigidBody

The first body.

body2 RigidBody

The second body.

center JVector

The joint center in world space.

axis JVector

The sliding axis in world space.

limit LinearLimit

Allowed displacement along the sliding axis.

drive JointDrive

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

pinned bool

If true, lock relative rotation with FixedAngle; otherwise constrain it with HingeAngle.

Exceptions

ArgumentOutOfRangeException

The drive selection is invalid.

ArgumentException

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

PrismaticJoint(World, RigidBody, RigidBody, JVector, JVector, LinearLimit, bool)

Initializes a new prismatic joint.

public PrismaticJoint(World world, RigidBody body1, RigidBody body2, JVector center, JVector axis, LinearLimit limit, bool pinned)

Parameters

world World

The world containing both bodies.

body1 RigidBody

The first body.

body2 RigidBody

The second body.

center JVector

The joint center in world space.

axis JVector

The sliding axis in world space.

limit LinearLimit

Allowed displacement along the sliding axis.

pinned bool

If true, lock relative rotation with FixedAngle; otherwise constrain it with HingeAngle.

Exceptions

ArgumentOutOfRangeException

The drive selection is invalid.

ArgumentException

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

PrismaticJoint(World, RigidBody, RigidBody, JVector, JVector, LinearLimit, bool, bool)

Initializes a new prismatic joint.

[Obsolete("Use the overload accepting JointDrive instead of hasMotor.")]
public PrismaticJoint(World world, RigidBody body1, RigidBody body2, JVector center, JVector axis, LinearLimit limit, bool pinned = true, bool hasMotor = false)

Parameters

world World

The world containing both bodies.

body1 RigidBody

The first body.

body2 RigidBody

The second body.

center JVector

The joint center in world space.

axis JVector

The sliding axis in world space.

limit LinearLimit

Allowed displacement along the sliding axis.

pinned bool

If true, lock relative rotation with FixedAngle; otherwise constrain it with HingeAngle.

hasMotor bool

Exceptions

ArgumentOutOfRangeException

The drive selection is invalid.

ArgumentException

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

PrismaticJoint(World, RigidBody, RigidBody, JVector, JVector, bool)

Initializes a new prismatic joint.

public PrismaticJoint(World world, RigidBody body1, RigidBody body2, JVector center, JVector axis, bool pinned)

Parameters

world World

The world containing both bodies.

body1 RigidBody

The first body.

body2 RigidBody

The second body.

center JVector

The joint center in world space.

axis JVector

The sliding axis in world space.

pinned bool

If true, lock relative rotation with FixedAngle; otherwise constrain it with HingeAngle.

Exceptions

ArgumentOutOfRangeException

The drive selection is invalid.

ArgumentException

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

PrismaticJoint(World, RigidBody, RigidBody, JVector, JVector, bool, bool)

Initializes a new prismatic joint.

[Obsolete("Use the overload accepting JointDrive instead of hasMotor.")]
public PrismaticJoint(World world, RigidBody body1, RigidBody body2, JVector center, JVector axis, bool pinned = true, bool hasMotor = false)

Parameters

world World

The world containing both bodies.

body1 RigidBody

The first body.

body2 RigidBody

The second body.

center JVector

The joint center in world space.

axis JVector

The sliding axis in world space.

pinned bool

If true, lock relative rotation with FixedAngle; otherwise constrain it with HingeAngle.

hasMotor bool

Exceptions

ArgumentOutOfRangeException

The drive selection is invalid.

ArgumentException

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

Properties

Body1

public RigidBody Body1 { get; }

Property Value

RigidBody

Body2

public RigidBody Body2 { get; }

Property Value

RigidBody

FixedAngle

public FixedAngle? FixedAngle { get; }

Property Value

FixedAngle

HingeAngle

public HingeAngle? HingeAngle { get; }

Property Value

HingeAngle

Motor

public LinearMotor? Motor { get; }

Property Value

LinearMotor

Servo

public LinearAxisServo? Servo { get; }

Property Value

LinearAxisServo

Slider

public PointOnLine Slider { get; }

Property Value

PointOnLine