Vertices Engine  v1.9.2.92
A Cross Platform game engine developed by Virtex Edge Design.
Loading...
Searching...
No Matches
VerticesEngine.vxMathHelper Class Reference

Math Helper Library with an extension of Mathematically Helpful Functions. More...

Classes

class  EasingFunctions
 

Public Types

enum  vxFunction {
  Linear , QuadraticEaseIn , QuadraticEaseOut , QuadraticEaseInOut ,
  CubicEaseIn , CubicEaseOut , CubicEaseInOut , QuarticEaseIn ,
  QuarticEaseOut , QuarticEaseInOut , QuinticEaseIn , QuinticEaseOut ,
  QuinticEaseInOut , SineEaseIn , SineEaseOut , SineEaseInOut ,
  CircularEaseIn , CircularEaseOut , CircularEaseInOut , ExponentialEaseIn ,
  ExponentialEaseOut , ExponentialEaseInOut , ElasticEaseIn , ElasticEaseOut ,
  ElasticEaseInOut , BackEaseIn , BackEaseOut , BackEaseInOut ,
  BounceEaseIn , BounceEaseOut , BounceEaseInOut
}
 Easing Functions enumeration.
 

Static Public Member Functions

static float Cos (float d)
 The cosine given the angle in degrees.
 
static float Sin (float d)
 
static float RoundToNearestHalf (float value)
 Rounds to nearest half.
 
static int RoundToNearestTen (float value)
 Rounds to nearest ten.
 
static float RoundToNearestSpecifiedNumber (float value, float valueToRoundTo)
 Rounds to nearest specified number.
 
static Vector2 RoundVector2 (Vector2 value, float valueToRoundTo)
 Rounds to nearest specified number.
 
static float DegToRad (float degrees)
 Converts degrees to radians.
 
static float RadToDeg (float radians)
 Converts Radians to Degrees.
 
static float Map (float s, float a1, float a2, float b1, float b2)
 
static int Map (int s, float a1, float a2, float b1, float b2)
 
static string GetVector2String (Vector2 vector, float DecPt)
 Gets the vector2 string.
 
static int Clamp (int value, int min, int max)
 
static float Clamp (float value, float min, float max)
 
static float Clamp01 (float value)
 
static float Clamp01 (int value)
 
static Vector2 GetRotatedVector (float rotation)
 Gets the rotated vector.
 
static float GetRotationFromDirection (Vector2 direction)
 Gets the rotation from direction.
 
static float Smooth (float whatItIs, float whatItShouldBe, float stepSize)
 Smooths a float by a stepsize.
 
static int Smooth (int whatItIs, int whatItShouldBe, int stepSize)
 Smooths a int by a stepsize.
 
static Color Smooth (Color whatItIs, Color whatItShouldBe, float stepSize)
 Smooths a Color by a stepsize.
 
static Vector2 Smooth (Vector2 whatItIs, Vector2 whatItShouldBe, float stepSize)
 Smooths a 2D Vector by a stepsize.
 
static Vector3 Smooth (Vector3 whatItIs, Vector3 whatItShouldBe, float stepSize)
 Smooths a 3D Vector by a stepsize.
 
static float Ease (float t, vxFunction function)
 Interpolate using the specified function. Taken from 'https://github.com/acron0/Easings/blob/master/Easings.cs'.
 

Static Public Attributes

const float E = 2.71828175F
 
const float Log10E = 0.4342945F
 
const float Log2E = 1.442695F
 
const float PI = 3.14159274F
 
const float PIOver2 = 1.57079637F
 
const float PIOver4 = 0.7853982F
 
const float TwoPI = 6.28318548F
 

Detailed Description

Math Helper Library with an extension of Mathematically Helpful Functions.

Member Function Documentation

◆ Cos()

static float VerticesEngine.vxMathHelper.Cos ( float d)
static

The cosine given the angle in degrees.

Parameters
dThe angle in degrees
Returns

◆ DegToRad()

static float VerticesEngine.vxMathHelper.DegToRad ( float degrees)
static

Converts degrees to radians.

Parameters
degrees
Returns

◆ GetRotatedVector()

static Vector2 VerticesEngine.vxMathHelper.GetRotatedVector ( float rotation)
static

Gets the rotated vector.

Returns
The rotated vector.
Parameters
rotationRotation.

◆ GetRotationFromDirection()

static float VerticesEngine.vxMathHelper.GetRotationFromDirection ( Vector2 direction)
static

Gets the rotation from direction.

Returns
The rotation from direction.
Parameters
directionDirection.

◆ GetVector2String()

static string VerticesEngine.vxMathHelper.GetVector2String ( Vector2 vector,
float DecPt )
static

Gets the vector2 string.

Returns
The vector2 string.
Parameters
vectorVector.
DecPtDec point.

◆ RadToDeg()

static float VerticesEngine.vxMathHelper.RadToDeg ( float radians)
static

Converts Radians to Degrees.

Parameters
radians
Returns

◆ RoundToNearestHalf()

static float VerticesEngine.vxMathHelper.RoundToNearestHalf ( float value)
static

Rounds to nearest half.

Returns
The to nearest half.
Parameters
valueValue.

◆ RoundToNearestSpecifiedNumber()

static float VerticesEngine.vxMathHelper.RoundToNearestSpecifiedNumber ( float value,
float valueToRoundTo )
static

Rounds to nearest specified number.

Returns
The to nearest specified number.
Parameters
valueValue.
valueToRoundToValue to round to.

◆ RoundToNearestTen()

static int VerticesEngine.vxMathHelper.RoundToNearestTen ( float value)
static

Rounds to nearest ten.

Returns
The to nearest ten.
Parameters
valueThe index.

◆ RoundVector2()

static Vector2 VerticesEngine.vxMathHelper.RoundVector2 ( Vector2 value,
float valueToRoundTo )
static

Rounds to nearest specified number.

Returns
The to nearest number.
Parameters
valueValue.
valueToRoundToValue to round to.

◆ Smooth() [1/5]

static Color VerticesEngine.vxMathHelper.Smooth ( Color whatItIs,
Color whatItShouldBe,
float stepSize )
static

Smooths a Color by a stepsize.

Parameters
whatItIsWhat it is.
whatItShouldBeWhat it should be.
stepSizeStep size.

◆ Smooth() [2/5]

static float VerticesEngine.vxMathHelper.Smooth ( float whatItIs,
float whatItShouldBe,
float stepSize )
static

Smooths a float by a stepsize.

Parameters
whatItIsWhat it is.
whatItShouldBeWhat it should be.
stepSizeStep size.

◆ Smooth() [3/5]

static int VerticesEngine.vxMathHelper.Smooth ( int whatItIs,
int whatItShouldBe,
int stepSize )
static

Smooths a int by a stepsize.

Parameters
whatItIsWhat it is.
whatItShouldBeWhat it should be.
stepSizeStep size.

◆ Smooth() [4/5]

static Vector2 VerticesEngine.vxMathHelper.Smooth ( Vector2 whatItIs,
Vector2 whatItShouldBe,
float stepSize )
static

Smooths a 2D Vector by a stepsize.

Parameters
whatItIsWhat it is.
whatItShouldBeWhat it should be.
stepSizeStep size.

◆ Smooth() [5/5]

static Vector3 VerticesEngine.vxMathHelper.Smooth ( Vector3 whatItIs,
Vector3 whatItShouldBe,
float stepSize )
static

Smooths a 3D Vector by a stepsize.

Parameters
whatItIsWhat it is.
whatItShouldBeWhat it should be.
stepSizeStep size.

The documentation for this class was generated from the following files: