Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PhysicsDistanceJointDefinition

A joint definition used to specify properties when creating a PhysicsDistanceJoint.
Read time 2 minutesLast updated 8 days ago

Definition

public struct PhysicsDistanceJointDefinition

Constructors

Constructor

Description

PhysicsDistanceJointDefinition()Create a default PhysicsDistanceJoint definition.
PhysicsDistanceJointDefinition(System.Boolean)Create a default PhysicsDistanceJoint definition.

Properties

Property

Description

bodyAThe first body the joint constrains.
bodyBThe second body the joint constrains.
collideConnectedWhether the shapes on the pair of bodies can come into contact.
distanceThe desired distance constraint i.e. the rest length of this joint. This has a lower stable limit of just above zero.
drawScaleControls the scaling of the joint drawing. Not all joints have scalable elements but those that do will use this scaling.
enableLimitEnable/disable the joint limit.
enableMotorEnable/Disable the joint motor.
enableSpringEnable/Disable the distance constraint to behave like a spring. If false then the distance joint will be rigid, overriding the limit and motor.
forceThresholdThe force threshold beyond which a joint event will be produced.
localAnchorAThe local anchor frame constraint relative to bodyA's origin.
localAnchorBThe local anchor frame constraint relative to bodyB's origin.
maxDistanceLimitMaximum length limit of this joint. Must be greater than or equal to the minimum length.
maxMotorForceThe maximum force the motor can apply, usually in newtons.
minDistanceLimitMinimum length limit of this joint. This will be clamped to a lower stable limit.
motorSpeedThe desired motor speed, usually in meters per second.
springDampingThe spring linear damping, non-dimensional. Use 1 for critical damping.
springFrequencyThe spring linear stiffness frequency, in cycles per second.
springLowerForceThe lower spring force controls how much tension the spring can sustain.
springUpperForceThe upper spring force controls how much compression the spring can sustain.
torqueThresholdThe torque threshold beyond which a joint event will be produced.
tuningDampingControls the joint stiffness damping, non-dimensional. Use 1 for critical damping.
tuningFrequencyControls the joint stiffness frequency, in cycles per second.

Static Properties

Property

Description

defaultDefinitionGet a default PhysicsDistanceJoint definition.