Class FloatExtensions
Inheritance
FloatExtensions
Assembly: GGL.dll
Syntax
public static class FloatExtensions
Methods
|
Edit this page
View Source
Abs(float)
Returns the absolute value of f.
Declaration
public static float Abs(this float value)
Parameters
Type |
Name |
Description |
float |
value |
|
Returns
|
Edit this page
View Source
Clamp(float, float)
Declaration
public static float Clamp(this float value, float max)
Parameters
Returns
|
Edit this page
View Source
Clamp(float, float, float)
Clamps the given value between the given minimum float and maximum float values. Returns the given value if it is within the minimum and maximum range.
Declaration
public static float Clamp(this float value, float min, float max)
Parameters
Type |
Name |
Description |
float |
value |
The floating point value to restrict inside the range defined by the minimum and maximum values.
|
float |
min |
The minimum floating point value to compare against.
|
float |
max |
The maximum floating point value to compare against.
|
Returns
Type |
Description |
float |
The float result between the minimum and maximum values.
|
|
Edit this page
View Source
IsWithin(float, float, float)
Checks if value is within a range [a,b].
Declaration
public static bool IsWithin(this float value, float a, float b)
Parameters
Returns
|
Edit this page
View Source
Remap(float, float, float, float, float)
Remaps a value from a range [a,b] to a range [c,d].
Declaration
public static float Remap(this float value, float a, float b, float c, float d)
Parameters
Returns
|
Edit this page
View Source
Round(float)
Returns f rounded to the nearest integer.
Declaration
public static int Round(this float value)
Parameters
Type |
Name |
Description |
float |
value |
|
Returns