Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

VRageMath.MyMath

Morten Aune Lyrstad edited this page Apr 16, 2022 · 41 revisions

IndexNamespace Index

MyMath Class

public abstract sealed class MyMath

Namespace: VRageMath
Assembly: VRage.Math.dll

Fields

static Vector3 Vector3One

Methods

static Vector3 Abs(ref Vector3 vector)

static float AngleBetween(Vector3 a, Vector3 b)

static Vector3 AngleTo(Vector3 From, Vector3 Location)

AngleTo

static float ArcTanAngle(float x, float y)

ArcTanAngle

static float Clamp(float val, float min, float max)

static float CosineDistance(ref Vector3 a, ref Vector3 b)

static double CosineDistance(ref Vector3D a, ref Vector3D b)

static BoundingBox CreateFromInsideRadius(float radius)

static float DistanceSquaredFromLineSegment(Vector3 v, Vector3 w, Vector3 p)

Return minimum distance between line segment v-w and point p.

static float FastCos(float angle)

static float FastSin(float angle)

static float FastTanH(float x)

Fast approximation of Hyperbolic tangent Max deviation is <3%

static Vector3 ForwardVectorProjection(Vector3 forwardVector, Vector3 projectedVector)

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.

static void InitializeFastSin()

static Vector3 MaxComponents(ref Vector3 a, ref Vector3 b)

Return vector with each component max

static int Mod(int x, int m)

static long Mod(long x, int m)

static float NormalizeAngle(float angle, float center = 0)

static Vector3 QuaternionToEuler(Quaternion Rotation)

QuaternionToEuler

static Vector3 VectorFromColor(byte red, byte green, byte blue)

Calculates color from vector

static Vector4 VectorFromColor(byte red, byte green, byte blue, byte alpha)

Clone this wiki locally