Struct Constraint
Syntax
public struct Constraint : IEquatable<Constraint>
Fields
ConstrainedAxes
Declaration
public bool3 ConstrainedAxes
Field Value
Type |
Description |
Unity.Mathematics.bool3 |
|
DefaultSpringDamping
Declaration
public const float DefaultSpringDamping = 2530.12158F
Field Value
DefaultSpringFrequency
Declaration
public const float DefaultSpringFrequency = 61950.9766F
Field Value
Max
Declaration
Field Value
Min
Declaration
Field Value
SpringDamping
Declaration
public float SpringDamping
Field Value
SpringFrequency
Declaration
public float SpringFrequency
Field Value
Type
Declaration
public ConstraintType Type
Field Value
Methods
BallAndSocket(Single, Single)
Constrains linear motion about all three axes to zero.
Declaration
public static Constraint BallAndSocket(float springFrequency = 61950.9766F, float springDamping = 2530.12158F)
Parameters
Type |
Name |
Description |
Single |
springFrequency |
|
Single |
springDamping |
|
Returns
Cone(Int32, Math.FloatRange, Single, Single)
Constrains angular motion about two axes within the specified range. Rotation around the third is unrestricted.
Declaration
public static Constraint Cone(int freeAxis, Math.FloatRange angularRange, float springFrequency = 61950.9766F, float springDamping = 2530.12158F)
Parameters
Type |
Name |
Description |
Int32 |
freeAxis |
The axis specifying the height of the cone within which the bodies may rotate.
|
Math.FloatRange |
angularRange |
The minimum required angle and maximum possible angle between the free axis and its bind pose orientation.
A minimum value of zero produces a conical range of motion, while a minimum value greater than zero results in motion restricted to the intersection of the inner and outer cones.
|
Single |
springFrequency |
|
Single |
springDamping |
|
Returns
Cylindrical(Int32, Math.FloatRange, Single, Single)
Constrains linear motion about two axes within the specified range. Movement about the third is unrestricted.
Declaration
public static Constraint Cylindrical(int freeAxis, Math.FloatRange distanceRange, float springFrequency = 61950.9766F, float springDamping = 2530.12158F)
Parameters
Type |
Name |
Description |
Int32 |
freeAxis |
The axis along which the bodies may freely translate.
|
Math.FloatRange |
distanceRange |
The minimum required distance and maximum possible distance between the constrained bodies about the two constrained axes.
A minimum value of zero produces a cylindrical range of motion, while a minimum value greater than zero results in a tube-shaped range of motion.
|
Single |
springFrequency |
|
Single |
springDamping |
|
Returns
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type |
Name |
Description |
Object |
obj |
|
Returns
Overrides
Equals(Constraint)
Declaration
public bool Equals(Constraint other)
Parameters
Returns
FixedAngle(Single, Single)
Constrains angular motion about all three axes to zero.
Declaration
public static Constraint FixedAngle(float springFrequency = 61950.9766F, float springDamping = 2530.12158F)
Parameters
Type |
Name |
Description |
Single |
springFrequency |
|
Single |
springDamping |
|
Returns
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
Hinge(Int32, Single, Single)
Constrains angular motion about two axes to zero. Rotation around the third is unrestricted.
Declaration
public static Constraint Hinge(int freeAxis, float springFrequency = 61950.9766F, float springDamping = 2530.12158F)
Parameters
Type |
Name |
Description |
Int32 |
freeAxis |
The axis around which the bodies may freely rotate.
|
Single |
springFrequency |
|
Single |
springDamping |
|
Returns
LimitedDistance(Math.FloatRange, Single, Single)
Constrains linear motion about all three axes within the specified range.
Declaration
public static Constraint LimitedDistance(Math.FloatRange distanceRange, float springFrequency = 61950.9766F, float springDamping = 2530.12158F)
Parameters
Type |
Name |
Description |
Math.FloatRange |
distanceRange |
The minimum required distance and maximum possible distance between the constrained bodies.
|
Single |
springFrequency |
|
Single |
springDamping |
|
Returns
Planar(Int32, Math.FloatRange, Single, Single)
Constrains linear motion about one axis within the specified range. Movement about the other two is unrestricted.
Declaration
public static Constraint Planar(int limitedAxis, Math.FloatRange distanceRange, float springFrequency = 61950.9766F, float springDamping = 2530.12158F)
Parameters
Type |
Name |
Description |
Int32 |
limitedAxis |
The axis along which the bodies' translation is restricted.
|
Math.FloatRange |
distanceRange |
The minimum required distance and maximum possible distance between the constrained bodies about the constrained axis.
Identical minimum and maximum values result in a plane, while different values constrain the bodies between two parallel planes.
|
Single |
springFrequency |
|
Single |
springDamping |
|
Returns
Twist(Int32, Math.FloatRange, Single, Single)
Constrains angular motion about about one axis within the specified range.
Declaration
public static Constraint Twist(int limitedAxis, Math.FloatRange angularRange, float springFrequency = 61950.9766F, float springDamping = 2530.12158F)
Parameters
Type |
Name |
Description |
Int32 |
limitedAxis |
The axis around which the bodies' rotation is restricted.
|
Math.FloatRange |
angularRange |
The minimum required angle and maximum possible angle of rotation between the constrained bodies around the constrained axis.
|
Single |
springFrequency |
|
Single |
springDamping |
|
Returns