Vec3

3D Vector structure with x, y, and z coordinates

Constructors

this
this(float x, float y, float z)

Constructor for Vec3

Members

Functions

len
float len()

Calculates the length of the vector

Static functions

add
Vec3 add(Vec3 left, Vec3 right)

Adds two vectors component-wise

cross
Vec3 cross(Vec3 v0, Vec3 v1)

Calculates the cross product of two vectors

dot
float dot(Vec3 v0, Vec3 v1)

Calculates the dot product of two vectors

mul
Vec3 mul(Vec3 v, float s)

Multiplies a vector by a scalar

norm
Vec3 norm(Vec3 v)

Normalizes a vector

sub
Vec3 sub(Vec3 left, Vec3 right)

Subtracts two vectors component-wise

up
Vec3 up()

Returns a vector pointing upwards (0, 1, 0)

zero
Vec3 zero()

Creates a zero vector

Variables

x
float x;
y
float y;
z
float z;
Undocumented in source.

Meta