Class AOMath
- Namespace
- AO
- Assembly
- CoreAssembly.dll
Math functions.
public static class AOMath
- Inheritance
-
AOMath
- Inherited Members
Methods
CalculateFriction(float, float, float)
public static float CalculateFriction(float friction, float time, float dt)
Parameters
Returns
Lerp(float, float, float)
Linear interpolation between two values.
public static float Lerp(float a, float b, float t)
Parameters
Returns
Mat4d(float)
public static Matrix4 Mat4d(float d)
Parameters
d
float
Returns
MoveToward(float, float, float)
Move a value towards another value by a given amount
public static float MoveToward(float from, float to, float delta)
Parameters
Returns
MoveTowardInt(int, int, int)
Move a value towards another value by a given amount
public static int MoveTowardInt(int from, int to, int delta)
Parameters
Returns
Mul(Matrix4, Matrix4)
public static Matrix4 Mul(Matrix4 a, Matrix4 b)
Parameters
Returns
NextPowerOfTwo(int)
Returns the next power of two after or at n. E.g. NextPowerOfTwo(9) -> 16, NextPowerOfTwo(16) -> 16.
public static int NextPowerOfTwo(int n)
Parameters
n
int
Returns
RealMod(int, int)
What we normally call the 'mod' operator, %, actually computes the remainder, not modulus. This function computes modulus.
public static int RealMod(int a, int b)
Parameters
Returns
Rotate(float, Vector3)
public static Matrix4 Rotate(float degrees, Vector3 axis)
Parameters
Returns
Scale(Vector3)
public static Matrix4 Scale(Vector3 scale)
Parameters
scale
Vector3
Returns
SinXY(float, float, float)
Oscillates between x and y by sin(t).
public static float SinXY(float x, float y, float t)
Parameters
Returns
ToDegrees(float)
public static float ToDegrees(float radians)
Parameters
radians
float
Returns
ToRadians(float)
public static float ToRadians(float degrees)
Parameters
degrees
float
Returns
TransformPoint(Matrix4, Vector2)
Transform a 2D point by given matrix.
public static Vector2 TransformPoint(Matrix4 matrix, Vector2 pos)
Parameters
Returns
TransformPoint(Matrix4, Vector3)
Transform a 3D point by given matrix.
public static Vector2 TransformPoint(Matrix4 matrix, Vector3 pos)
Parameters
Returns
Translate(Vector2)
public static Matrix4 Translate(Vector2 translation)
Parameters
translation
Vector2
Returns
Transpose(Matrix4)
public static Matrix4 Transpose(Matrix4 matrix)
Parameters
matrix
Matrix4
Returns
Unlerp(float, float, float)
Returns the percentage that value is between a and b. E.g. Unlerp(10, 20, 15) would be 0.5 because 15 is halfways between 10 and 20.
public static float Unlerp(float a, float b, float value)