Struct Math.FloatRange
Range of possible values for some constrained parameter.
Implements
Inherited Members
Namespace: Unity.Physics
Assembly: Unity.Physics.dll
Syntax
public struct Math.FloatRange : IEquatable<Math.FloatRange>
Constructors
FloatRange(float, float)
Constructor.
Declaration
public FloatRange(float min, float max)
Parameters
Type | Name | Description |
---|---|---|
float | min | The minimum. |
float | max | The maximum. |
Fields
Max
The maximum.
Declaration
public float Max
Field Value
Type | Description |
---|---|
float |
Min
The minimum.
Declaration
public float Min
Field Value
Type | Description |
---|---|
float |
Properties
Mid
Gets the middle.
Declaration
public float Mid { get; }
Property Value
Type | Description |
---|---|
float | 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 |
---|---|
bool | True if the objects are considered equal, false if they are not. |
Overrides
Equals(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 |
---|---|
bool | True if the objects are considered equal, false if they are not. |
GetHashCode()
Calculates a hash code for this object.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | 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 operator FloatRange(float2)
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 operator float2(FloatRange)
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. |