Vector3

Vector3 is a structure that defines a three-dimensional point.

Constructors

this
this(T x, T y, T z = 0)

CTor

this
this(U x, U y, U z = 0)

CTor

this
this(const Vector3!(U) vec)

CTor

Members

Aliases

dot
alias dot = scalar

alias for scalar

Functions

cross
Vector3!(T) cross(const Vector3!(T) vec)

Returns the cross product of this and another Vector.

diff
float diff(const Vector3!(T) vec)

Calculate the diff between two vectors.

isEmpty
bool isEmpty()

Checks if this vector is empty. This means that his coordinates are 0.

normalize
Vector3!(T) normalize()

Normalize the vector in which the coordinates are divided by the length.

opBinary
Vector3!(T) opBinary(const Vector3!(T) vec)

Supported operation: +, -, *, / and %

opBinary
Vector3!(T) opBinary(float num)

Supported operation: +, -, *, / and %

opEquals
bool opEquals(const Vector3!(T) vec)

Compares two vectors by checking whether the coordinates are equals.

opOpAssign
Vector3!(T) opOpAssign(const Vector3!(T) vec)

Supported operation: +=, -=, *=, /= and %=

opOpAssign
Vector3!(T) opOpAssign(float num)

Supported operation: +=, -=, *=, /= and %=

rotate
Vector3!(T) rotate(float angle, const Vector3!(T) rot)

Rotate the current Vector by an angle and rotation Vector and returns the result

scalar
float scalar(const Vector3!(T) vec)

Calculate the scalar product.

Properties

length
float length [@property getter]

Calculate the length.

Variables

x
T x;

The x coordinate

y
T y;

The y coordinate

z
T z;

The z coordinate

Meta

Authors

Randy Schuett (rswhite4@googlemail.com)