Class VectorMath
- Namespace
- OmegaEngine.Foundation.Geometry
- Assembly
- OmegaEngine.Foundation.dll
Math helpers related to vectors.
public static class VectorMath
- Inheritance
-
VectorMath
- Inherited Members
Methods
ByteToAngle(ByteVector4)
Maps a vector of 0-255 byte values to a vector of 0�-180� angles in radians.
[Pure]
public static Vector4 ByteToAngle(this ByteVector4 vector)
Parameters
vector
ByteVector4
Returns
- Vector4
ByteToAngle(byte)
Maps a 0-255 byte value to a 0�-180� angle in radians.
[Pure]
public static double ByteToAngle(this byte b)
Parameters
b
byte
Returns
InterpolateTrigonometric(float, params Vector4[])
Performs smooth (trigonometric) interpolation between two or more values
[Pure]
public static Vector4 InterpolateTrigonometric(float factor, params Vector4[] values)
Parameters
factor
floatA factor between 0 and
values
.Lengthvalues
Vector4[]The value checkpoints
Returns
- Vector4
Lerp(DoubleVector3, DoubleVector3, double)
Performs linear interpolation between two vectors.
[Pure]
public static DoubleVector3 Lerp(DoubleVector3 vector1, DoubleVector3 vector2, double factor)
Parameters
vector1
DoubleVector3The starting vector.
vector2
DoubleVector3The ending vector.
factor
doubleInterpolation factor between 0 and 1.
Returns
- DoubleVector3
The interpolated vector.
Rotate(Vector2, float)
Rotates a SlimDX.Vector2 by rotation
around the origin.
[Pure]
public static Vector2 Rotate(this Vector2 value, float rotation)
Parameters
value
Vector2The original vector.
rotation
floatThe angle to rotate by in degrees.
Returns
- Vector2
The rotated SlimDX.Vector2.
RotateAroundAxis(DoubleVector3, DoubleVector3, double)
Rotates a DoubleVector3 around an arbitrary axis.
public static DoubleVector3 RotateAroundAxis(this DoubleVector3 value, DoubleVector3 axis, double rotation)
Parameters
value
DoubleVector3The original vector.
axis
DoubleVector3The axis to rotate around.
rotation
doubleThe angle to rotate by in degrees.
Returns
- DoubleVector3
The rotated DoubleVector3.
UnitVector(double, double)
Calculates a unit vector using spherical coordinates.
[Pure]
public static Vector3 UnitVector(double inclination, double azimuth)
Parameters
inclination
doubleAngle away from positive Z axis in radians. Values from 0 to Pi.
azimuth
doubleAngle away from positive X axis in radians. Values from 0 to 2*Pi.
Returns
- Vector3