Floating point math constants and utilities.
public static class MathfRemarks
Provides common floating point constants static methods.
Members at a glance
| Kind | Members |
|---|---|
| Fields | DegreesPerRadian · E · PI · PiOverTwo · RadiansPerDegree · RootTwo · RootTwoOverTwo · TwoOverPi · TwoPi |
| Methods | Clamp · IsApproximatelyEqualAbsolute |
Fields
DegreesPerRadian
public const float DegreesPerRadianConversion factor to convert radians to degrees.
E
public const float EE
PI
public const float PIPi
PiOverTwo
public const float PiOverTwoPi divided by two.
RadiansPerDegree
public const float RadiansPerDegreeConversion factor to convert degrees to radians.
RootTwo
public const float RootTwoThe square root of two.
RootTwoOverTwo
public const float RootTwoOverTwoThe square root of 2 divided by two.
TwoOverPi
public const float TwoOverPiTwo divided by pi.
TwoPi
public const float TwoPiTwo times pi.
Methods
Clamp
public static float Clamp(float x, float min, float max)Clamps a float to the specified range
| Parameter | Type | Description |
|---|---|---|
x | float | The float to compare. |
min | float | The minimum of the clamp range. |
max | float | The maximum of the clamp range. |
Returns: float — x if x is within [min,max] otherwise min or max, whichever is closer to the value of x.
IsApproximatelyEqualAbsolute
public static bool IsApproximatelyEqualAbsolute(float a, float b)Compares the two given floats and returns true if they are approximately equal
| Parameter | Type | Description |
|---|---|---|
a | float | The first float to compare. |
b | float | The second float to compare. |
Returns: bool — true if the float are approximately equal, false otherwise.
Remarks
Checks if the absolute value of the difference of the values is small.
Used in examples
- MoverExample2.cs
- MoverExample3.cs
MoverExample4.cs- ScriptLibrary/Scene/Dispenser.cs
- ScriptLibrary/Scene/KeyframedMotion.cs
- ScriptLibrary/Scene/Mover.cs
Generated from the Sansar 47.10.0 client ScriptApi snapshot.