{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Struct PhysicsJoint | Unity Physics | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    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.

    Implements
    IComponentData
    IQueryTypeParameter
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    ValueType.ToString()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    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.

    Extension Methods

    JointComponentExtensions.GetLimitedDOFAxes(in PhysicsJoint, out bool3, out bool3)
    JointComponentExtensions.GetLimitedDistanceRange(in PhysicsJoint)
    JointComponentExtensions.GetLimitedHingeRange(in PhysicsJoint)
    JointComponentExtensions.GetPrismaticRange(in PhysicsJoint)
    JointComponentExtensions.GetRagdollPerpendicularConeRange(in PhysicsJoint)
    JointComponentExtensions.GetRagdollPrimaryConeAndTwistRange(in PhysicsJoint, out float, out Math.FloatRange)
    JointComponentExtensions.SetLimitedDistanceRange(ref PhysicsJoint, Math.FloatRange)
    JointComponentExtensions.SetLimitedHingeRange(ref PhysicsJoint, Math.FloatRange)
    JointComponentExtensions.SetPrismaticRange(ref PhysicsJoint, Math.FloatRange)
    JointComponentExtensions.SetRagdollPerpendicularConeRange(ref PhysicsJoint, Math.FloatRange)
    JointComponentExtensions.SetRagdollPrimaryConeAndTwistRange(ref PhysicsJoint, float, Math.FloatRange)
    JointComponentExtensions.setLimitedDOFAxes(ref PhysicsJoint, bool3, bool3)
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)