Class JointComponentExtensions
Extension methods for working with PhysicsJoint.
Inherited Members
Namespace: Unity.Physics.Extensions
Assembly: Unity.Physics.dll
Syntax
public static class JointComponentExtensions
Methods
GetLimitedDOFAxes(in PhysicsJoint, out bool3, out bool3)
Gets the constrained degrees of freedom of a PhysicsJoint created using CreateLimitedDOF(RigidTransform, bool3, bool3) .
Declaration
public static void GetLimitedDOFAxes(this in PhysicsJoint joint, out bool3 linearAxes, out bool3 angularAxes)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint | The joint. |
bool3 | linearAxes | [out] The linear axes constrained by the joint. |
bool3 | angularAxes | [out] The angular axes constrained by the joint. |
GetLimitedDistanceRange(in PhysicsJoint)
Gets the range of motion for a PhysicsJoint created using CreateLimitedDistance(float3, float3, FloatRange) .
Declaration
public static Math.FloatRange GetLimitedDistanceRange(this in PhysicsJoint joint)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint | The joint. |
Returns
Type | Description |
---|---|
Math.FloatRange | The minimum required distance and maximum possible distance between the two anchor points. |
GetLimitedHingeRange(in PhysicsJoint)
Gets the range of motion for a PhysicsJoint created using CreateLimitedHinge(BodyFrame, BodyFrame, FloatRange) .
Declaration
public static Math.FloatRange GetLimitedHingeRange(this in PhysicsJoint joint)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint | The joint. |
Returns
Type | Description |
---|---|
Math.FloatRange | The minimum required and maximum possible angle of rotation about the aligned axes. |
GetPrismaticRange(in PhysicsJoint)
Gets the range of motion for a PhysicsJoint created using CreatePrismatic(BodyFrame, BodyFrame, FloatRange) .
Declaration
public static Math.FloatRange GetPrismaticRange(this in PhysicsJoint joint)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint | The joint. |
Returns
Type | Description |
---|---|
Math.FloatRange | The minimum required and maximum possible distance between the two anchor points along their aligned axes. |
GetRagdollPerpendicularConeRange(in PhysicsJoint)
Gets the range of motion for a ragdoll perpendicular cone PhysicsJoint created using CreateRagdoll(BodyFrame, BodyFrame, float, FloatRange, FloatRange, out PhysicsJoint, out PhysicsJoint).
Declaration
public static Math.FloatRange GetRagdollPerpendicularConeRange(this in PhysicsJoint joint)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint | The joint. |
Returns
Type | Description |
---|---|
Math.FloatRange | The range of angular motion defining the cones perpendicular to the primary cone, between which the primary axis may swing. This range may be asymmetrical. |
GetRagdollPrimaryConeAndTwistRange(in PhysicsJoint, out float, out FloatRange)
Gets the range of motion for a ragdoll primary cone PhysicsJoint created using CreateRagdoll(BodyFrame, BodyFrame, float, FloatRange, FloatRange, out PhysicsJoint, out PhysicsJoint) .
Declaration
public static void GetRagdollPrimaryConeAndTwistRange(this in PhysicsJoint joint, out float maxConeAngle, out Math.FloatRange angularTwistRange)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint | The joint. |
float | maxConeAngle | [out] Half angle of the primary cone, which defines the maximum possible range of motion in which the primary axis is restricted. |
Math.FloatRange | angularTwistRange | [out] The range of angular motion for twisting around the primary axis within the region defined by the primary and perpendicular cones. This range is usually symmetrical. |
SetLimitedDistanceRange(ref PhysicsJoint, FloatRange)
Applies the specified range of motion to a PhysicsJoint created using CreateLimitedDistance(float3, float3, FloatRange) .
Declaration
public static void SetLimitedDistanceRange(this ref PhysicsJoint joint, Math.FloatRange distanceRange)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint | [in,out] The joint. |
Math.FloatRange | distanceRange | The minimum required distance and maximum possible distance between the two anchor points. |
SetLimitedHingeRange(ref PhysicsJoint, FloatRange)
Applies the specified range of motion to a PhysicsJoint created using CreateLimitedHinge(BodyFrame, BodyFrame, FloatRange) .
Declaration
public static void SetLimitedHingeRange(this ref PhysicsJoint joint, Math.FloatRange angularRange)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint | [in,out] The joint. |
Math.FloatRange | angularRange | The minimum required and maximum possible angle of rotation about the aligned axes. |
SetPrismaticRange(ref PhysicsJoint, FloatRange)
Applies the specified range of motion to a PhysicsJoint created using CreatePrismatic(BodyFrame, BodyFrame, FloatRange) .
Declaration
public static void SetPrismaticRange(this ref PhysicsJoint joint, Math.FloatRange distanceOnAxis)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint | [in,out] The joint. |
Math.FloatRange | distanceOnAxis | The minimum required and maximum possible distance between the two anchor points along their aligned axes. |
SetRagdollPerpendicularConeRange(ref PhysicsJoint, FloatRange)
Applies the specified range of motion to a ragdoll perpendicular cone PhysicsJoint created using CreateRagdoll(BodyFrame, BodyFrame, float, FloatRange, FloatRange, out PhysicsJoint, out PhysicsJoint).
Declaration
public static void SetRagdollPerpendicularConeRange(this ref PhysicsJoint joint, Math.FloatRange angularPlaneRange)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint | [in,out] The joint. |
Math.FloatRange | angularPlaneRange | The range of angular motion defining the cones perpendicular to the primary cone, between which the primary cone's axis may swing. This range may be asymmetrical, and is clamped to the range (-pi/2, pi/2). |
SetRagdollPrimaryConeAndTwistRange(ref PhysicsJoint, float, FloatRange)
Applies the specified range of motion to a ragdoll primary cone PhysicsJoint created using CreateRagdoll(BodyFrame, BodyFrame, float, FloatRange, FloatRange, out PhysicsJoint, out PhysicsJoint).
Declaration
public static void SetRagdollPrimaryConeAndTwistRange(this ref PhysicsJoint joint, float maxConeAngle, Math.FloatRange angularTwistRange)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint | [in,out] The joint. |
float | maxConeAngle | Half angle of the primary cone, which defines the maximum possible range of motion in which the primary axis is restricted. This value is clamped to the range (-pi, pi). |
Math.FloatRange | angularTwistRange | The range of angular motion for twisting around the primary axis within the region defined by the primary and perpendicular cones. This range is usually symmetrical, and is clamped to the range (-pi, pi). |
setLimitedDOFAxes(ref PhysicsJoint, bool3, bool3)
Applies the constrained degrees of freedom to a PhysicsJoint created using CreateLimitedDOF(RigidTransform, bool3, bool3) .
Declaration
public static void setLimitedDOFAxes(this ref PhysicsJoint joint, bool3 linearAxes, bool3 angularAxes)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint | [in,out] The joint. |
bool3 | linearAxes | The linear axes constrained by the joint. |
bool3 | angularAxes | The angular axes constrained by the joint. |