Struct PhysicsJoint
A set of constraints on the relative motion of a PhysicsConstrainedBodyPair. Most joint types can be described with a single instance, but complex setups like ragdoll joints require more than one instance to stabilize. In these cases, you should associate multiple joints using PhysicsJointCompanion.
Inherited Members
Namespace: Unity.Physics
Assembly: solution.dll
Syntax
public struct PhysicsJoint : IComponentData, IQueryTypeParameter
Properties
Name | Description |
---|---|
BodyAFromJoint | The anchor point and orientation in the space of the first body. |
BodyBFromJoint | The target point and orientation in the space of the second body. |
this[int] | Access to Constraint atom with provided index. |
JointType | An optional property to provide a hint about what behavior the underlying constraints represent. Use it in conjunction with convenience setters in JointComponentExtensions to modify constraints. Its value is set when you use a factory method to construct a new PhysicsJoint instance, but it has no effect on joint behavior. See also. |
Version | A counter to keep track of changes to the joint's definition. Use it with back-ends like Havok that cache information about the joint if its properties have not changed. |
Methods
Name | Description |
---|---|
CreateAngularVelocityMotor(BodyFrame, BodyFrame, float, float) | Create a AngularVelocityMotor joint. This is an angular motor that will spin around an axis at the specified constant target velocity. |
CreateBallAndSocket(float3, float3) | Create a BallAndSocket joint. |
CreateFixed(BodyFrame, BodyFrame) | Create a Fixed joint. |
CreateHinge(BodyFrame, BodyFrame) | Create a Hinge joint. |
CreateLimitedDOF(RigidTransform, bool3, bool3) | Create a LimitedDegreeOfFreedom joint. |
CreateLimitedDistance(float3, float3, FloatRange) | Create a LimitedDistance joint. |
CreateLimitedDistance(float3, float3, FloatRange, float3, float, float) | Create a LimitedDistance joint. |
CreateLimitedHinge(BodyFrame, BodyFrame, FloatRange) | Create a LimitedHinge joint. |
CreateLinearVelocityMotor(BodyFrame, BodyFrame, float, float) | Create a LinearVelocityMotor joint. This is a motorized prismatic joint type that will drive to a constant target relative velocity, in a specified direction. |
CreatePositionMotor(BodyFrame, BodyFrame, float, float) | Create a PositionMotor joint. This is a motorized prismatic joint that drives bodies toward the specified relative target position, along one axis. |
CreatePrismatic(BodyFrame, BodyFrame, FloatRange) | Create a Prismatic joint. |
CreateRagdoll(BodyFrame, BodyFrame, float, FloatRange, FloatRange, out PhysicsJoint, out PhysicsJoint) | Create a RagdollPrimaryCone and RagdollPerpendicularCone joint suitable for multi-axial joints on characters. The primary axis of the joined bodies can rotate within a range of motion defined by the maximum cone angle, minus the intersection with a pair of cones along the perpendicular axis. The bodies may also twist about the primary axis within this range. |
CreateRotationalMotor(BodyFrame, BodyFrame, float, float) | Create a RotationalMotor joint. This is an angular motor that will drive towards the specified target angle, about an axis. |
GetConstraintCount() | Get number of Constraint atoms in this joint. |
GetConstraints() | Get the sequence of Constraint atoms to apply between the two bodies. |
SetConstraints(FixedList512Bytes<Constraint>) | Set the sequence of Constraints to apply between the two bodies. |
SetImpulseEventThresholdAllConstraints(float3) | Set the impulse event threshold for all eligible constraints (non-motorized ones) in this joint. |
SetImpulseEventThresholdAllConstraints(float3, float3) | Set the impulse event threshold for all eligible constraints (non-motorized ones) in this joint. |
SetImpulseEventThresholdSingleConstraint(int, float3) | Set the impulse event threshold of a constraint specified by constraint index. If a selected constraint is a motor, this function will have no effect. |