Struct Math.FloatRange
Range of possible values for some constrained parameter.
Inherited Members
Namespace: Unity.Physics
Syntax
public struct FloatRange : IEquatable<Math.FloatRange>
Constructors
FloatRange(Single, Single)
Constructor.
Declaration
public FloatRange(float min, float max)
Parameters
Type | Name | Description |
---|---|---|
Single | min | The minimum. |
Single | max | The maximum. |
Fields
Max
The maximum.
Declaration
public float Max
Field Value
Type | Description |
---|---|
Single |
Min
The minimum.
Declaration
public float Min
Field Value
Type | Description |
---|---|
Single |
Properties
Mid
Gets the middle.
Declaration
public readonly float Mid { get; }
Property Value
Type | Description |
---|---|
Single | The middle. |
Methods
Equals(Object)
Tests if this object is considered equal to another.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | The object to compare to this object. |
Returns
Type | Description |
---|---|
Boolean | True if the objects are considered equal, false if they are not. |
Overrides
Equals(Math.FloatRange)
Tests if this FloatRange is considered equal to another.
Declaration
public bool Equals(Math.FloatRange other)
Parameters
Type | Name | Description |
---|---|---|
Math.FloatRange | other | The float range to compare to this object. |
Returns
Type | Description |
---|---|
Boolean | True if the objects are considered equal, false if they are not. |
Implements
GetHashCode()
Calculates a hash code for this object.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code for this object. |
Overrides
Sorted()
Returns a sorted copy of this instance.
Declaration
public Math.FloatRange Sorted()
Returns
Type | Description |
---|---|
Math.FloatRange | A copy of this instance, where Min is the lesser of Min and Max , and Max is the greater of the two. |
ToString()
Convert this object into a string representation.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string that represents this object. |
Overrides
Operators
Implicit(float2 to Math.FloatRange)
Implicit cast that converts the given float2 to a FloatRange.
Declaration
public static implicit operator Math.FloatRange(float2 f)
Parameters
Type | Name | Description |
---|---|---|
float2 | f | A float2 to process. |
Returns
Type | Description |
---|---|
Math.FloatRange | The result of the operation. |
Implicit(Math.FloatRange to float2)
Implicit cast that converts the given FloatRange to a float2.
Declaration
public static implicit operator float2(Math.FloatRange range)
Parameters
Type | Name | Description |
---|---|---|
Math.FloatRange | range | The range. |
Returns
Type | Description |
---|---|
float2 | The result of the operation. |