Table of Contents

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

output double[]
a double[]
b double[]

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

output double[]

the receiving vector

a double[]

the source vector

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

output double[]
a double[]
b double[]

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

a double[]
b double[]

Returns

double

Divide(double[], double[], double[])

Divides two vec3's

public static double[] Divide(double[] output, double[] a, double[] b)

Parameters

output double[]
a double[]
b double[]

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

a double[]
b double[]

Returns

double

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

x double
y double
z double

Returns

double[]

Length_(double[])

Calculates the length of a vec3

public static double Length_(double[] a)

Parameters

a double[]

Returns

double

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

output double[]
a double[]
b double[]
t double

Returns

double[]

Max(double[], double[], double[])

Returns the maximum of two vec3's

public static double[] Max(double[] output, double[] a, double[] b)

Parameters

output double[]
a double[]
b double[]

Returns

double[]

Min(double[], double[], double[])

Returns the minimum of two vec3's

public static double[] Min(double[] output, double[] a, double[] b)

Parameters

output double[]
a double[]
b double[]

Returns

double[]

Multiply(double[], double[], double[])

Multiplies two vec3's

public static double[] Multiply(double[] output, double[] a, double[] b)

Parameters

output double[]
a double[]
b double[]

Returns

double[]

Negate(double[], double[])

Negates the components of a vec3

public static double[] Negate(double[] output, double[] a)

Parameters

output double[]
a double[]

Returns

double[]

Normalize(double[], double[])

Normalize a vec3

public static double[] Normalize(double[] output, double[] a)

Parameters

output double[]
a double[]

Returns

double[]

Scale(double[], double[], double)

Scales a vec3 by a scalar number

public static double[] Scale(double[] output, double[] a, double b)

Parameters

output double[]
a double[]
b double

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

output double[]
a double[]
b double[]
scale double

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

output double[]

the receiving vector

x double
y double
z double

Returns

double[]

SqrLen(double[])

SquaredLength()

public static double SqrLen(double[] a)

Parameters

a double[]

Returns

double

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

a double[]
b double[]

Returns

double

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

double

Substract(double[], double[], double[])

Subtracts vector b from vector a. Returns {vec3} out

public static double[] Substract(double[] output, double[] a, double[] b)

Parameters

output double[]
a double[]

the first operand

b double[]

the second operand

Returns

double[]

TransformMat3(double[], double[], double[])

Transforms the vec3 with a mat3.

public static double[] TransformMat3(double[] output, double[] a, double[] m)

Parameters

output double[]
a double[]

the vector to transform

m double[]

the 3x3 matrix to transform with

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

output double[]
a double[]
m double[]

Returns

double[]

TransformQuat(double[], double[], double[])

Transforms the vec3 with a quat

public static double[] TransformQuat(double[] output, double[] a, double[] q)

Parameters

output double[]
a double[]
q double[]

Returns

double[]