Class JointComponentExtensions
Extension methods for working with PhysicsJoint.
Namespace: Unity.Physics.Extensions
Syntax
public static class JointComponentExtensions
Methods
GetLimitedDistanceRange(PhysicsJoint)
Gets the range of motion for a PhysicsJoint created using CreateLimitedDistance(float3, float3, Math.FloatRange).
Declaration
public static Math.FloatRange GetLimitedDistanceRange(this in PhysicsJoint joint)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint |
Returns
Type | Description |
---|---|
Math.FloatRange | The minimum required distance and maximum possible distance between the two anchor points. |
GetLimitedHingeRange(PhysicsJoint)
Gets the range of motion for a PhysicsJoint created using CreateLimitedHinge(BodyFrame, BodyFrame, Math.FloatRange).
Declaration
public static Math.FloatRange GetLimitedHingeRange(this in PhysicsJoint joint)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint |
Returns
Type | Description |
---|---|
Math.FloatRange | The minimum required and maximum possible angle of rotation about the aligned axes. |
GetPrismaticRange(PhysicsJoint)
Gets the range of motion for a PhysicsJoint created using CreatePrismatic(BodyFrame, BodyFrame, Math.FloatRange).
Declaration
public static Math.FloatRange GetPrismaticRange(this in PhysicsJoint joint)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint |
Returns
Type | Description |
---|---|
Math.FloatRange | The minimum required and maximum possible distance between the two anchor points along their aligned axes. |
GetRagdollPerpendicularConeRange(PhysicsJoint)
Gets the range of motion for a ragdoll perpendicular cone PhysicsJoint created using CreateRagdoll(BodyFrame, BodyFrame, Single, Math.FloatRange, Math.FloatRange, out PhysicsJoint, out PhysicsJoint).
Declaration
public static Math.FloatRange GetRagdollPerpendicularConeRange(this in PhysicsJoint joint)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | 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(PhysicsJoint, out Single, out Math.FloatRange)
Gets the range of motion for a ragdoll primary cone PhysicsJoint created using CreateRagdoll(BodyFrame, BodyFrame, Single, Math.FloatRange, Math.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 | |
Single | maxConeAngle | Half angle of the primary cone, which defines the maximum possible range of motion in which the primary axis is restricted. |
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. |
SetLimitedDistanceRange(ref PhysicsJoint, Math.FloatRange)
Applies the specified range of motion to a PhysicsJoint created using CreateLimitedDistance(float3, float3, Math.FloatRange).
Declaration
public static void SetLimitedDistanceRange(this ref PhysicsJoint joint, Math.FloatRange distanceRange)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint | |
Math.FloatRange | distanceRange | The minimum required distance and maximum possible distance between the two anchor points. |
SetLimitedHingeRange(ref PhysicsJoint, Math.FloatRange)
Applies the specified range of motion to a PhysicsJoint created using CreateLimitedHinge(BodyFrame, BodyFrame, Math.FloatRange).
Declaration
public static void SetLimitedHingeRange(this ref PhysicsJoint joint, Math.FloatRange angularRange)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint | |
Math.FloatRange | angularRange | The minimum required and maximum possible angle of rotation about the aligned axes. |
SetPrismaticRange(ref PhysicsJoint, Math.FloatRange)
Applies the specified range of motion to a PhysicsJoint created using CreatePrismatic(BodyFrame, BodyFrame, Math.FloatRange).
Declaration
public static void SetPrismaticRange(this ref PhysicsJoint joint, Math.FloatRange distanceOnAxis)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | joint | |
Math.FloatRange | distanceOnAxis | The minimum required and maximum possible distance between the two anchor points along their aligned axes. |
SetRagdollPerpendicularConeRange(ref PhysicsJoint, Math.FloatRange)
Applies the specified range of motion to a ragdoll perpendicular cone PhysicsJoint created using CreateRagdoll(BodyFrame, BodyFrame, Single, Math.FloatRange, Math.FloatRange, out PhysicsJoint, out PhysicsJoint).
Declaration
public static void SetRagdollPerpendicularConeRange(this ref PhysicsJoint joint, Math.FloatRange angularPlaneRange)
Parameters
Type | Name | Description |
---|---|---|
PhysicsJoint | 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, Single, Math.FloatRange)
Applies the specified range of motion to a ragdoll primary cone PhysicsJoint created using CreateRagdoll(BodyFrame, BodyFrame, Single, Math.FloatRange, Math.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 | |
Single | 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). |