Struct JointData
Namespace: Unity.Physics
Syntax
[Obsolete("JointData is no longer used. Body frame, version, and constraint data are now all part of Joint. (RemovedAfter 2020-08-15)")]
public struct JointData
Fields
Constraints
Declaration
public JointData.ConstraintsBlob Constraints
Field Value
Type | Description |
---|---|
JointData.ConstraintsBlob |
Properties
AFromJoint
Declaration
public Math.MTransform AFromJoint { get; set; }
Property Value
Type | Description |
---|---|
Math.MTransform |
BFromJoint
Declaration
public Math.MTransform BFromJoint { get; set; }
Property Value
Type | Description |
---|---|
Math.MTransform |
Version
Declaration
public byte Version { get; }
Property Value
Type | Description |
---|---|
Byte |
Methods
Create(BodyFrame, BodyFrame, NativeArray<Constraint>)
Declaration
public static BlobAssetReference<JointData> Create(BodyFrame bodyAFromJoint, BodyFrame bodyBFromJoint, NativeArray<Constraint> constraints)
Parameters
Type | Name | Description |
---|---|---|
BodyFrame | bodyAFromJoint | |
BodyFrame | bodyBFromJoint | |
NativeArray<Constraint> | constraints |
Returns
Type | Description |
---|---|
BlobAssetReference<JointData> |
CreateBallAndSocket(float3, float3)
Creates a joint constraining the point on body A to the point on body B, about which the bodies can freely rotate.
Declaration
public static BlobAssetReference<JointData> CreateBallAndSocket(float3 anchorA, float3 anchorB)
Parameters
Type | Name | Description |
---|---|---|
Unity.Mathematics.float3 | anchorA | Specifies the anchor point in the space of body A. |
Unity.Mathematics.float3 | anchorB | Specifies the target point in the space of body B. |
Returns
Type | Description |
---|---|
BlobAssetReference<JointData> |
CreateFixed(BodyFrame, BodyFrame)
Creates a joint constraining the position and orientation on body A to the target position and orientation on body B.
Declaration
public static BlobAssetReference<JointData> CreateFixed(BodyFrame bodyAFromJoint, BodyFrame bodyBFromJoint)
Parameters
Type | Name | Description |
---|---|---|
BodyFrame | bodyAFromJoint | Specifies a reference point and orientation in the space of body A. |
BodyFrame | bodyBFromJoint | Specifies a target point and orientation in the space of body B. |
Returns
Type | Description |
---|---|
BlobAssetReference<JointData> |
CreateHinge(BodyFrame, BodyFrame)
Creates a joint constraining an anchor point on body A to a target point on body B, where each body can rotate freely about the vector where their axes align. The perpendicular axes of each joint frame have no effect.
Declaration
public static BlobAssetReference<JointData> CreateHinge(BodyFrame bodyAFromJoint, BodyFrame bodyBFromJoint)
Parameters
Type | Name | Description |
---|---|---|
BodyFrame | bodyAFromJoint | Specifies the anchor point and axis of rotation in the space of body A. |
BodyFrame | bodyBFromJoint | Specifies the target point and axis of alignment in the space of body B. |
Returns
Type | Description |
---|---|
BlobAssetReference<JointData> |
CreateLimitedDistance(float3, float3, Math.FloatRange)
Creates a joint constraining the point on body A to the point on body B within the specified permissible linear distance range.
Declaration
public static BlobAssetReference<JointData> CreateLimitedDistance(float3 anchorA, float3 anchorB, Math.FloatRange distanceRange)
Parameters
Type | Name | Description |
---|---|---|
Unity.Mathematics.float3 | anchorA | Specifies the anchor point in the space of body A. |
Unity.Mathematics.float3 | anchorB | Specifies the target point in the space of body B. |
Math.FloatRange | distanceRange | The minimum required distance and maximum possible distance between the two anchor points. |
Returns
Type | Description |
---|---|
BlobAssetReference<JointData> |
CreateLimitedHinge(BodyFrame, BodyFrame, Math.FloatRange)
Creates a joint constraining an anchor point on body A to the target point on body B, where each body can rotate within a limited range about the vector where their axes align. The perpendicular axes of each joint frame are used as a reference point for the range of motion.
Declaration
public static BlobAssetReference<JointData> CreateLimitedHinge(BodyFrame bodyAFromJoint, BodyFrame bodyBFromJoint, Math.FloatRange angularRange)
Parameters
Type | Name | Description |
---|---|---|
BodyFrame | bodyAFromJoint | Specifies the anchor point, axis of rotation, and rest orientation in the space of body A. |
BodyFrame | bodyBFromJoint | Specifies the target point, axis of alignment, and reference orientation in the space of body B. |
Math.FloatRange | angularRange | The minimum required and maximum possible angle of rotation about the aligned axes. |
Returns
Type | Description |
---|---|
BlobAssetReference<JointData> |
CreatePrismatic(BodyFrame, BodyFrame, Math.FloatRange, Math.FloatRange)
Creates a joint constraining an anchor on body A to a target point on body B, where the bodies can translate within a tube-shaped volume. The tube is oriented down the length of the vector where their axes align.
Declaration
public static BlobAssetReference<JointData> CreatePrismatic(BodyFrame bodyAFromJoint, BodyFrame bodyBFromJoint, Math.FloatRange distanceOnAxis, Math.FloatRange distanceFromAxis)
Parameters
Type | Name | Description |
---|---|---|
BodyFrame | bodyAFromJoint | Specifies the anchor point and axis of rotation in the space of body A. |
BodyFrame | bodyBFromJoint | Specifies the target point and axis of alignment in the space of body B. |
Math.FloatRange | distanceOnAxis | The minimum required and maximum possible distance between the two anchor points along their aligned axes. |
Math.FloatRange | distanceFromAxis | The minimum required and maximum possible distance between the two anchor points along a radius of the cylinder within which they can move. |
Returns
Type | Description |
---|---|
BlobAssetReference<JointData> |
CreateRagdoll(BodyFrame, BodyFrame, Single, Math.FloatRange, Math.FloatRange, out BlobAssetReference<JointData>, out BlobAssetReference<JointData>)
Creates a pair of joints constraining an anchor point on body A to a target point on body B, with a complex angular range of motion 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.
Declaration
public static void CreateRagdoll(BodyFrame bodyAFromJoint, BodyFrame bodyBFromJoint, float maxConeAngle, Math.FloatRange angularPlaneRange, Math.FloatRange angularTwistRange, out BlobAssetReference<JointData> jointData0, out BlobAssetReference<JointData> jointData1)
Parameters
Type | Name | Description |
---|---|---|
BodyFrame | bodyAFromJoint | Specifies the anchor point, axis of rotation, and rest orientation in the space of body A. |
BodyFrame | bodyBFromJoint | Specifies the target point, axis of alignment, and reference orientation in the space of body B. |
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 | angularPlaneRange | 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. |
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. |
BlobAssetReference<JointData> | jointData0 | The first joint in the system. |
BlobAssetReference<JointData> | jointData1 | The second joint in the system. |