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
worldWorldThe world containing both bodies.
body1RigidBodyThe first body.
body2RigidBodyThe second body.
centerJVectorThe joint center in world space.
axisJVectorThe sliding axis in world space.
Exceptions
- ArgumentOutOfRangeException
The drive selection is invalid.
- ArgumentException
Thrown when
centercontains a non-finite value, whenaxisis zero or contains a non-finite value, when either limit value is NaN, when either body does not belong toworld, 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
worldWorldThe world containing both bodies.
body1RigidBodyThe first body.
body2RigidBodyThe second body.
centerJVectorThe joint center in world space.
axisJVectorThe sliding axis in world space.
driveJointDriveThe optional drive. Motor and servo force default to zero.
pinnedboolIf true, lock relative rotation with FixedAngle; otherwise constrain it with HingeAngle.
Exceptions
- ArgumentOutOfRangeException
The drive selection is invalid.
- ArgumentException
Thrown when
centercontains a non-finite value, whenaxisis zero or contains a non-finite value, when either limit value is NaN, when either body does not belong toworld, 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
worldWorldThe world containing both bodies.
body1RigidBodyThe first body.
body2RigidBodyThe second body.
centerJVectorThe joint center in world space.
axisJVectorThe sliding axis in world space.
limitLinearLimitAllowed displacement along the sliding axis.
Exceptions
- ArgumentOutOfRangeException
The drive selection is invalid.
- ArgumentException
Thrown when
centercontains a non-finite value, whenaxisis zero or contains a non-finite value, when either limit value is NaN, when either body does not belong toworld, 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
worldWorldThe world containing both bodies.
body1RigidBodyThe first body.
body2RigidBodyThe second body.
centerJVectorThe joint center in world space.
axisJVectorThe sliding axis in world space.
limitLinearLimitAllowed displacement along the sliding axis.
driveJointDriveThe optional drive. Motor and servo force default to zero.
pinnedboolIf true, lock relative rotation with FixedAngle; otherwise constrain it with HingeAngle.
Exceptions
- ArgumentOutOfRangeException
The drive selection is invalid.
- ArgumentException
Thrown when
centercontains a non-finite value, whenaxisis zero or contains a non-finite value, when either limit value is NaN, when either body does not belong toworld, 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
worldWorldThe world containing both bodies.
body1RigidBodyThe first body.
body2RigidBodyThe second body.
centerJVectorThe joint center in world space.
axisJVectorThe sliding axis in world space.
limitLinearLimitAllowed displacement along the sliding axis.
pinnedboolIf true, lock relative rotation with FixedAngle; otherwise constrain it with HingeAngle.
Exceptions
- ArgumentOutOfRangeException
The drive selection is invalid.
- ArgumentException
Thrown when
centercontains a non-finite value, whenaxisis zero or contains a non-finite value, when either limit value is NaN, when either body does not belong toworld, 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
worldWorldThe world containing both bodies.
body1RigidBodyThe first body.
body2RigidBodyThe second body.
centerJVectorThe joint center in world space.
axisJVectorThe sliding axis in world space.
limitLinearLimitAllowed displacement along the sliding axis.
pinnedboolIf true, lock relative rotation with FixedAngle; otherwise constrain it with HingeAngle.
hasMotorbool
Exceptions
- ArgumentOutOfRangeException
The drive selection is invalid.
- ArgumentException
Thrown when
centercontains a non-finite value, whenaxisis zero or contains a non-finite value, when either limit value is NaN, when either body does not belong toworld, 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
worldWorldThe world containing both bodies.
body1RigidBodyThe first body.
body2RigidBodyThe second body.
centerJVectorThe joint center in world space.
axisJVectorThe sliding axis in world space.
pinnedboolIf true, lock relative rotation with FixedAngle; otherwise constrain it with HingeAngle.
Exceptions
- ArgumentOutOfRangeException
The drive selection is invalid.
- ArgumentException
Thrown when
centercontains a non-finite value, whenaxisis zero or contains a non-finite value, when either limit value is NaN, when either body does not belong toworld, 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
worldWorldThe world containing both bodies.
body1RigidBodyThe first body.
body2RigidBodyThe second body.
centerJVectorThe joint center in world space.
axisJVectorThe sliding axis in world space.
pinnedboolIf true, lock relative rotation with FixedAngle; otherwise constrain it with HingeAngle.
hasMotorbool
Exceptions
- ArgumentOutOfRangeException
The drive selection is invalid.
- ArgumentException
Thrown when
centercontains a non-finite value, whenaxisis zero or contains a non-finite value, when either limit value is NaN, when either body does not belong toworld, or when both body references are the same.
Properties
Body1
public RigidBody Body1 { get; }
Property Value
Body2
public RigidBody Body2 { get; }
Property Value
FixedAngle
public FixedAngle? FixedAngle { get; }
Property Value
HingeAngle
public HingeAngle? HingeAngle { get; }
Property Value
Motor
public LinearMotor? Motor { get; }
Property Value
Servo
public LinearAxisServo? Servo { get; }
Property Value
Slider
public PointOnLine Slider { get; }