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 |
---|---|
ConstrainedAxes | The constrained axes. |
DampingRatio | The damping ratio. |
DefaultDampingRatio | The default damping ratio. |
DefaultMaxImpulse | The default maximum impulse. |
DefaultSpringDamping | Deprecated. Use DefaultDampingRatio instead. The default damping ratio. |
DefaultSpringFrequency | 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. |
MaxImpulse | The impulse threshold after which ImpulseEvent will be raised from this constraint. In case of motorized constraints, represents the maximum impulse that can be applied to it during one step. |
Min | The minimum. |
SpringDamping | Deprecated. Use DampingRatio instead. The spring damping ratio. |
SpringFrequency | 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 |
---|---|
ConstrainedAxis1D | Selects the constrained axis from a constraint with Dimension == 1 |
Dimension | Number of affected degrees of freedom. 1, 2, or 3. |
FreeAxis2D | Selects the free axis from a constraint with Dimension == 2 |
Methods
Name | Description |
---|---|
AngularVelocityMotor(float, float, float, float) | Drives bodies to a specified target angular velocity, around one axis. |
BallAndSocket(float, float) | Constrains linear motion about all three axes to zero. |
BallAndSocket(float3, float, float) | Constrains linear motion about all three axes to zero. |
Cone(int, FloatRange, float, float) | Constrains angular motion about two axes within the specified range. Rotation around the third is unrestricted. |
Cone(int, FloatRange, float3, float, float) | Constrains angular motion about two axes within the specified range. Rotation around the third is unrestricted. |
Cylindrical(int, FloatRange, float, float) | Constrains linear motion about two axes within the specified range. Movement about the third is unrestricted. |
Cylindrical(int, FloatRange, float3, float, 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. |
FixedAngle(float, float) | Constrains angular motion about all three axes to zero. |
FixedAngle(float3, float, float) | Constrains angular motion about all three axes to zero. |
GetHashCode() | 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. |
LimitedDistance(FloatRange, float, float) | Constrains linear motion about all three axes within the specified range. |
LimitedDistance(FloatRange, float3, float, float) | Constrains linear motion about all three axes within the specified range. |
LinearVelocityMotor(float, float, float, float) | Drives bodies to a specified target relative velocity, along one axis. |
MotorPlanar(float, float, float, float) | Moves bodies along one axis to specified target distance. Movement about the other two perpendicular axes is unrestricted. |
MotorTwist(float, float, float, float) | Constrains angular motion about one axis and drives towards the specified target rotation. |
Planar(int, FloatRange, float, float) | Constrains linear motion about one axis within the specified range. Movement about the other two is unrestricted. |
Planar(int, FloatRange, float3, float, float) | Constrains linear motion about one axis within the specified range. Movement about the other two is unrestricted. |
Twist(int, FloatRange, float, float) | Constrains angular motion about about one axis within the specified range. |
Twist(int, FloatRange, float3, float, float) | Constrains angular motion about about one axis within the specified range. |