Class Vec3Utilsd
- Namespace
- Vintagestory.API.MathTools
- Assembly
- VintagestoryAPI.dll
Don't use this class unless you need it to interoperate with Mat4d
public class Vec3Utilsd
- Inheritance
-
Vec3Utilsd
- Inherited Members
- Extension Methods
Methods
Add(double[], double[], double[])
Adds two vec3's. returns {vec3} out
public static double[] Add(double[] output, double[] a, double[] b)
Parameters
Returns
- double[]
CloneIt(double[])
Creates a new vec3 initialized with values from an existing vector. Returns {vec3} a new 3D vector
public static double[] CloneIt(double[] a)
Parameters
a
double[]vector to clone
Returns
- double[]
Copy(double[], double[])
Copy the values from one vec3 to another. Returns {vec3} out
public static double[] Copy(double[] output, double[] a)
Parameters
Returns
- double[]
Create()
public static double[] Create()
Returns
- double[]
Cross(double[], double[], double[])
Computes the cross product of two vec3's
public static double[] Cross(double[] output, double[] a, double[] b)
Parameters
Returns
- double[]
Distance(double[], double[])
Calculates the euclidian distance between two vec3's. Returns {Number} distance between a and b
public static double Distance(double[] a, double[] b)
Parameters
Returns
Divide(double[], double[], double[])
Divides two vec3's
public static double[] Divide(double[] output, double[] a, double[] b)
Parameters
Returns
- double[]
Dot(double[], double[])
Calculates the dot product of two vec3's. Returns {Number} dot product of a and b
public static double Dot(double[] a, double[] b)
Parameters
Returns
FromValues(double, double, double)
Creates a new vec3 initialized with the given values. Returns {vec3} a new 3D vector
public static double[] FromValues(double x, double y, double z)
Parameters
Returns
- double[]
Length_(double[])
Calculates the length of a vec3
public static double Length_(double[] a)
Parameters
a
double[]
Returns
Lerp(double[], double[], double[], double)
Performs a linear interpolation between two vec3's
public static double[] Lerp(double[] output, double[] a, double[] b, double t)
Parameters
Returns
- double[]
Max(double[], double[], double[])
Returns the maximum of two vec3's
public static double[] Max(double[] output, double[] a, double[] b)
Parameters
Returns
- double[]
Min(double[], double[], double[])
Returns the minimum of two vec3's
public static double[] Min(double[] output, double[] a, double[] b)
Parameters
Returns
- double[]
Multiply(double[], double[], double[])
Multiplies two vec3's
public static double[] Multiply(double[] output, double[] a, double[] b)
Parameters
Returns
- double[]
Negate(double[], double[])
Negates the components of a vec3
public static double[] Negate(double[] output, double[] a)
Parameters
Returns
- double[]
Normalize(double[], double[])
Normalize a vec3
public static double[] Normalize(double[] output, double[] a)
Parameters
Returns
- double[]
Scale(double[], double[], double)
Scales a vec3 by a scalar number
public static double[] Scale(double[] output, double[] a, double b)
Parameters
Returns
- double[]
ScaleAndAdd(double[], double[], double[], double)
Adds two vec3's after scaling the second operand by a scalar value
public static double[] ScaleAndAdd(double[] output, double[] a, double[] b, double scale)
Parameters
Returns
- double[]
Set(double[], double, double, double)
Set the components of a vec3 to the given values. Returns {vec3} out
public static double[] Set(double[] output, double x, double y, double z)
Parameters
Returns
- double[]
SqrLen(double[])
SquaredLength()
public static double SqrLen(double[] a)
Parameters
a
double[]
Returns
SquaredDistance(double[], double[])
Calculates the squared euclidian distance between two vec3's. Returns {Number} squared distance between a and b
public static double SquaredDistance(double[] a, double[] b)
Parameters
Returns
SquaredLength(double[])
Calculates the squared length of a vec3. Returns {Number} squared length of a
public static double SquaredLength(double[] a)
Parameters
a
double[]
Returns
Substract(double[], double[], double[])
Subtracts vector b from vector a. Returns {vec3} out
public static double[] Substract(double[] output, double[] a, double[] b)
Parameters
Returns
- double[]
TransformMat3(double[], double[], double[])
Transforms the vec3 with a mat3.
public static double[] TransformMat3(double[] output, double[] a, double[] m)
Parameters
Returns
- double[]
TransformMat4(double[], double[], double[])
Transforms the vec3 with a mat4. 4th vector component is implicitly '1'
public static double[] TransformMat4(double[] output, double[] a, double[] m)
Parameters
Returns
- double[]
TransformQuat(double[], double[], double[])
Transforms the vec3 with a quat
public static double[] TransformQuat(double[] output, double[] a, double[] q)
Parameters
Returns
- double[]