Class MyMath
Inheritance
System.Object
MyMath
Assembly: VRage.Math.dll
Syntax
public static class MyMath : Object
Fields
Vector3One
Declaration
public static Vector3 Vector3One
Field Value
Methods
Abs(ref Vector3)
Declaration
public static Vector3 Abs(ref Vector3 vector)
Parameters
| Type |
Name |
Description |
| Vector3 |
vector |
|
Returns
AngleBetween(Vector3, Vector3)
Declaration
public static float AngleBetween(Vector3 a, Vector3 b)
Parameters
Returns
| Type |
Description |
| System.Single |
|
AngleTo(Vector3, Vector3)
Declaration
public static Vector3 AngleTo(Vector3 From, Vector3 Location)
Parameters
Returns
| Type |
Description |
| Vector3 |
Angle between the vector lines
|
ArcTanAngle(Single, Single)
Declaration
public static float ArcTanAngle(float x, float y)
Parameters
| Type |
Name |
Description |
| System.Single |
x |
|
| System.Single |
y |
|
Returns
| Type |
Description |
| System.Single |
ArcTan angle between x and y
|
Clamp(Single, Single, Single)
Declaration
public static float Clamp(float val, float min, float max)
Parameters
| Type |
Name |
Description |
| System.Single |
val |
|
| System.Single |
min |
|
| System.Single |
max |
|
Returns
| Type |
Description |
| System.Single |
|
CosineDistance(ref Vector3, ref Vector3)
Declaration
public static float CosineDistance(ref Vector3 a, ref Vector3 b)
Parameters
Returns
| Type |
Description |
| System.Single |
|
CosineDistance(ref Vector3D, ref Vector3D)
Declaration
public static double CosineDistance(ref Vector3D a, ref Vector3D b)
Parameters
Returns
| Type |
Description |
| System.Double |
|
CreateFromInsideRadius(Single)
Declaration
public static BoundingBox CreateFromInsideRadius(float radius)
Parameters
| Type |
Name |
Description |
| System.Single |
radius |
|
Returns
DistanceSquaredFromLineSegment(Vector3, Vector3, Vector3)
Return minimum distance between line segment v-w and point p.
Declaration
public static float DistanceSquaredFromLineSegment(Vector3 v, Vector3 w, Vector3 p)
Parameters
Returns
| Type |
Description |
| System.Single |
|
FastCos(Single)
Declaration
public static float FastCos(float angle)
Parameters
| Type |
Name |
Description |
| System.Single |
angle |
|
Returns
| Type |
Description |
| System.Single |
|
FastSin(Single)
Declaration
public static float FastSin(float angle)
Parameters
| Type |
Name |
Description |
| System.Single |
angle |
|
Returns
| Type |
Description |
| System.Single |
|
FastTanH(Single)
Fast approximation of Hyperbolic tangent
Max deviation is <3%
Declaration
public static float FastTanH(float x)
Parameters
| Type |
Name |
Description |
| System.Single |
x |
|
Returns
| Type |
Description |
| System.Single |
|
ForwardVectorProjection(Vector3, Vector3)
This projection results to initial velocity of non-engine objects, which parents move in some velocity
We want to add only forward speed of the parent to the forward direction of the object, and if parent
is going backward, no speed is added.
Declaration
public static Vector3 ForwardVectorProjection(Vector3 forwardVector, Vector3 projectedVector)
Parameters
Returns
InitializeFastSin()
Declaration
public static void InitializeFastSin()
MaxComponents(ref Vector3, ref Vector3)
Return vector with each component max
Declaration
public static Vector3 MaxComponents(ref Vector3 a, ref Vector3 b)
Parameters
Returns
Mod(Int32, Int32)
Declaration
public static int Mod(int x, int m)
Parameters
| Type |
Name |
Description |
| System.Int32 |
x |
|
| System.Int32 |
m |
|
Returns
| Type |
Description |
| System.Int32 |
|
Mod(Int64, Int32)
Declaration
public static long Mod(long x, int m)
Parameters
| Type |
Name |
Description |
| System.Int64 |
x |
|
| System.Int32 |
m |
|
Returns
| Type |
Description |
| System.Int64 |
|
NormalizeAngle(Single, Single)
Declaration
public static float NormalizeAngle(float angle, float center = 0F)
Parameters
| Type |
Name |
Description |
| System.Single |
angle |
|
| System.Single |
center |
|
Returns
| Type |
Description |
| System.Single |
|
QuaternionToEuler(Quaternion)
Declaration
public static Vector3 QuaternionToEuler(Quaternion Rotation)
Parameters
Returns
| Type |
Description |
| Vector3 |
Converted quaternion to the euler pitch, rot, yaw
|
VectorFromColor(Byte, Byte, Byte)
Calculates color from vector
Declaration
public static Vector3 VectorFromColor(byte red, byte green, byte blue)
Parameters
| Type |
Name |
Description |
| System.Byte |
red |
|
| System.Byte |
green |
|
| System.Byte |
blue |
|
Returns
VectorFromColor(Byte, Byte, Byte, Byte)
Declaration
public static Vector4 VectorFromColor(byte red, byte green, byte blue, byte alpha)
Parameters
| Type |
Name |
Description |
| System.Byte |
red |
|
| System.Byte |
green |
|
| System.Byte |
blue |
|
| System.Byte |
alpha |
|
Returns