Class JointComponentExtensions | Unity Physics | 0.5.1-preview.2
docs.unity3d.com
    Show / Hide Table of Contents

    Class JointComponentExtensions

    Extension methods for working with PhysicsJoint.

    Inheritance
    Object
    JointComponentExtensions
    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.

    GetLimitedDOFAxes(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
    Unity.Mathematics.bool3 linearAxes

    The linear axes constrained by the joint.

    Unity.Mathematics.bool3 angularAxes

    The angular axes constrained by the joint.

    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.

    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
    Unity.Mathematics.bool3 linearAxes

    The linear axes constrained by the joint.

    Unity.Mathematics.bool3 angularAxes

    The angular axes constrained by the joint.

    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).

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023