Struct LinearLimit
- Namespace
- Jitter2.Dynamics.Constraints
- Assembly
- Jitter2.dll
Represents a linear limit defined by a minimum and maximum distance. Used by constraints to restrict translational motion within a specified range.
public struct LinearLimit : IFormattable
- Implements
- Inherited Members
Constructors
LinearLimit(float, float)
Represents a linear limit defined by a minimum and maximum distance. Used by constraints to restrict translational motion within a specified range.
public LinearLimit(float from, float to)
Parameters
Fields
Fixed
A limit that locks the position in place (no translation allowed).
public static readonly LinearLimit Fixed
Field Value
Full
A limit that allows unrestricted movement (negative to positive infinity).
public static readonly LinearLimit Full
Field Value
Properties
From
Gets or sets the minimum distance of the limit.
public float From { readonly get; set; }
Property Value
To
Gets or sets the maximum distance of the limit.
public float To { readonly get; set; }
Property Value
Methods
Deconstruct(out float, out float)
Deconstructs the limit into its minimum and maximum distances.
public readonly void Deconstruct(out float limitMin, out float limitMax)
Parameters
FromMinMax(float, float)
Creates a linear limit from minimum and maximum values.
public static LinearLimit FromMinMax(float min, float max)
Parameters
Returns
- LinearLimit
A new LinearLimit instance.
ToString()
Returns a string representation of the endpoints.
public override readonly string ToString()
Returns
ToString(string?)
Formats the endpoints using the specified numeric format and the current culture.
public readonly string ToString(string? format)
Parameters
formatstring
Returns
ToString(string?, IFormatProvider?)
Formats the endpoints using the specified numeric format and culture.
public readonly string ToString(string? format, IFormatProvider? formatProvider)
Parameters
formatstringA numeric format string, or null or empty to use the general format.
formatProviderIFormatProviderThe format provider, or null to use the current culture.