Struct Constraint
A linear or angular constraint in 1, 2, or 3 dimensions.
Implements
Inherited Members
Namespace: Unity.Physics
Assembly: solution.dll
Syntax
public struct Constraint : IEquatable<Constraint>
Fields
Name | Description |
---|---|
Constrained |
The constrained axes. |
Damping |
The damping ratio. |
Default |
The default damping ratio. |
Default |
The default maximum impulse. |
Default |
Deprecated. Use DefaultDampingRatio instead. The default damping ratio. |
Default |
The default spring frequency. (Immutable) Current default values give tau = 0.6 damping = 0.99 at 60hz The values are huge and we can't get damping = 1 -- a stiff constraint is the limit of a damped spring as spring params go to infinity. Rather than baking them these values could be calculated using JacobianUtilities.CalculateSpringFrequencyAndDamping(0.6f, 0.99f, math.rcp(60.0f), 4, out DefaultSpringFrequency, out DefaultDampingRatio); |
Max | The maximum. |
Max |
The impulse threshold after which Impulse |
Min | The minimum. |
Spring |
Deprecated. Use DampingRatio instead. The spring damping ratio. |
Spring |
The spring frequency. |
Target | The target a motor will drive towards. Can be set to zero for non-motor type constraints |
Type | The constraint type. |
Properties
Name | Description |
---|---|
Constrained |
Selects the constrained axis from a constraint with Dimension == 1 |
Dimension | Number of affected degrees of freedom. 1, 2, or 3. |
Free |
Selects the free axis from a constraint with Dimension == 2 |
Methods
Name | Description |
---|---|
Angular |
Drives bodies to a specified target angular velocity, around one axis. |
Ball |
Constrains linear motion about all three axes to zero. |
Ball |
Constrains linear motion about all three axes to zero. |
Cone(int, Float |
Constrains angular motion about two axes within the specified range. Rotation around the third is unrestricted. |
Cone(int, Float |
Constrains angular motion about two axes within the specified range. Rotation around the third is unrestricted. |
Cylindrical(int, Float |
Constrains linear motion about two axes within the specified range. Movement about the third is unrestricted. |
Cylindrical(int, Float |
Constrains linear motion about two axes within the specified range. Movement about the third is unrestricted. |
Equals(object) | Tests if this object is considered equal to another. |
Equals(Constraint) | Tests if this Constraint is considered equal to another. |
Fixed |
Constrains angular motion about all three axes to zero. |
Fixed |
Constrains angular motion about all three axes to zero. |
Get |
Calculates a hash code for this object. |
Hinge(int, float, float) | Constrains angular motion about two axes to zero. Rotation around the third is unrestricted. |
Hinge(int, float3, float, float) | Constrains angular motion about two axes to zero. Rotation around the third is unrestricted. |
Limited |
Constrains linear motion about all three axes within the specified range. |
Limited |
Constrains linear motion about all three axes within the specified range. |
Linear |
Drives bodies to a specified target relative velocity, along one axis. |
Motor |
Moves bodies along one axis to specified target distance. Movement about the other two perpendicular axes is unrestricted. |
Motor |
Constrains angular motion about one axis and drives towards the specified target rotation. |
Planar(int, Float |
Constrains linear motion about one axis within the specified range. Movement about the other two is unrestricted. |
Planar(int, Float |
Constrains linear motion about one axis within the specified range. Movement about the other two is unrestricted. |
Twist(int, Float |
Constrains angular motion about about one axis within the specified range. |
Twist(int, Float |
Constrains angular motion about about one axis within the specified range. |