Table of Contents

Class Vec3Utilsf

Namespace
Vintagestory.API.MathTools
Assembly
VintagestoryAPI.dll

Don't use this class unless you need it to interoperate with Mat4d

public class Vec3Utilsf
Inheritance
Vec3Utilsf
Inherited Members
Extension Methods

Methods

Add(float[], float[], float[])

Adds two vec3's

public static float[] Add(float[] output, float[] a, float[] b)

Parameters

output float[]

the receiving vector

a float[]

the first operand

b float[]

the second operand

Returns

float[]

CloneIt(float[])

Creates a new vec3 initialized with values from an existing vector. Returns {vec3} a new 3D vector

public static float[] CloneIt(float[] a)

Parameters

a float[]

Returns

float[]

Copy(float[], float[])

Copy the values from one vec3 to another. Returns {vec3} out

public static float[] Copy(float[] output, float[] a)

Parameters

output float[]

the receiving vector

a float[]

the source vector

Returns

float[]

Create()

public static float[] Create()

Returns

float[]

Cross(float[], float[], float[])

Computes the cross product of two vec3's. Returns {vec3} out

public static float[] Cross(float[] output, float[] a, float[] b)

Parameters

output float[]
a float[]
b float[]

Returns

float[]

Distance(float[], float[])

Calculates the euclidian distance between two vec3's. Returns {Number} distance between a and b

public static float Distance(float[] a, float[] b)

Parameters

a float[]
b float[]

Returns

float

Divide(float[], float[], float[])

Divides two vec3's

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

Parameters

output float[]
a float[]
b float[]

Returns

float[]

Dot(float[], float[])

Calculates the dot product of two vec3's. Returns {Number} dot product of a and b

public static float Dot(float[] a, float[] b)

Parameters

a float[]
b float[]

Returns

float

FromValues(float, float, float)

Creates a new vec3 initialized with the given values. Returns {vec3} a new 3D vector

public static float[] FromValues(float x, float y, float z)

Parameters

x float
y float
z float

Returns

float[]

Length_(float[])

Calculates the length of a vec3

public static float Length_(float[] a)

Parameters

a float[]

Returns

float

Lerp(float[], float[], float[], float)

Performs a linear interpolation between two vec3's

public static float[] Lerp(float[] output, float[] a, float[] b, float t)

Parameters

output float[]
a float[]
b float[]
t float

Returns

float[]

Max(float[], float[], float[])

Returns the maximum of two vec3's

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

Parameters

output float[]
a float[]
b float[]

Returns

float[]

Min(float[], float[], float[])

Returns the minimum of two vec3's

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

Parameters

output float[]
a float[]
b float[]

Returns

float[]

Mul(float[], float[], float[])

Alias of Mul()

public static float[] Mul(float[] output, float[] a, float[] b)

Parameters

output float[]
a float[]
b float[]

Returns

float[]

Multiply(float[], float[], float[])

Multiplies two vec3's

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

Parameters

output float[]
a float[]
b float[]

Returns

float[]

Negate(float[], float[])

Negates the components of a vec3

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

Parameters

output float[]
a float[]

Returns

float[]

Normalize(float[], float[])

Normalize a vec3

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

Parameters

output float[]
a float[]

Returns

float[]

Scale(float[], float[], float)

Scales a vec3 by a scalar number

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

Parameters

output float[]
a float[]
b float

Returns

float[]

ScaleAndAdd(float[], float[], float[], float)

Adds two vec3's after scaling the second operand by a scalar value

public static float[] ScaleAndAdd(float[] output, float[] a, float[] b, float scale)

Parameters

output float[]
a float[]
b float[]
scale float

Returns

float[]

Set(float[], float, float, float)

Set the components of a vec3 to the given values

public static float[] Set(float[] output, float x, float y, float z)

Parameters

output float[]
x float
y float
z float

Returns

float[]

SquaredDistance(float[], float[])

Calculates the squared euclidian distance between two vec3's. Returns {Number} squared distance between a and b

public static float SquaredDistance(float[] a, float[] b)

Parameters

a float[]
b float[]

Returns

float

SquaredLength(float[])

Calculates the squared length of a vec3. Returns {Number} squared length of a

public static float SquaredLength(float[] a)

Parameters

a float[]

Returns

float

Substract(float[], float[], float[])

Subtracts vector b from vector a

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

Parameters

output float[]
a float[]
b float[]

Returns

float[]

TransformMat3(float[], float[], float[])

Transforms the vec3 with a mat3. Returns {vec3} out

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

Parameters

output float[]
a float[]
m float[]

Returns

float[]

TransformMat4(float[], float[], float[])

Transforms the vec3 with a mat4. 4th vector component is implicitly '1'. Returns {vec3} out

public static float[] TransformMat4(float[] output, float[] a, float[] m)

Parameters

output float[]
a float[]
m float[]

Returns

float[]

TransformQuat(float[], float[], float[])

Transforms the vec3 with a quat

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

Parameters

output float[]
a float[]
q float[]

Returns

float[]