Skip to content
EvilEngine.Formats.Collision

JointLimit record struct

public readonly record struct JointLimit

How far a joint lets its child turn about one of its axes, as a least and a greatest angle in radians. A CollisionJoint and a JointSpec each hold three, for the joint’s X, Y and Z axes.

Limits = [JointLimit.Free, new JointLimit(0, 0), new JointLimit(-2.4, 0)]

The physics world leaves an axis free when its limit runs from -π or less to π or more, and holds it within the limit otherwise. A limit whose least is above its greatest, or either isn’t finite, is refused with ArgumentOutOfRangeException when the joint is made, and a collision holding one won’t be written.

Assembly
EvilEngine.Formats
Commit
4ff877b1

Members

JointLimit constructor

public JointLimit(double Min, double Max)

Makes a limit from its least and greatest angle in radians.

Free field

public static readonly JointLimit Free

-π to π, an axis free to turn all the way round. Every axis is free unless a joint says otherwise.

Min property

public double Min { get; init; }

The least angle in radians, how far the child may turn the negative way.

Max property

public double Max { get; init; }

The greatest angle in radians, how far the child may turn the positive way.

Locked property

public bool Locked { get; }

Whether Min and Max are the same, so the axis can’t turn at all.