Vector3

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

Constructors

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

CTor

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

CTor

this
this(U[3] pos)

CTor

this
this(Vector3!U vec)

CTor

Members

Aliases

dot
alias dot = scalar

alias for scalar

Functions

asArray
T[3] asArray()

Returns the Vector as static array.

cross
Vector3 cross(Vector3 vec)

Returns the cross product of this and another Vector.

diff
float diff(Vector3 vec)

Calculate the diff between two vectors.

isEmpty
bool isEmpty()

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

move
void move(T x, T y, T z)

Move the current coordinates.

negate
void negate()

Negate this Vector

opBinary
Vector3 opBinary(Vector3 vec)

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

opBinary
Vector3 opBinary(T number)

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

opEquals
bool opEquals(Vector3 vec)

Compares two vectors by checking whether the coordinates are equals.

opNeg
Vector3 opNeg()

Returns a negated copy of this Vector.

opOpAssign
Vector3 opOpAssign(Vector3 vec)

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

opOpAssign
Vector3 opOpAssign(T number)

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

scalar
float scalar(Vector3 vec)

Calculate the scalar product.

set
void set(T x, T y, T z)

Set new coordinates.

Properties

length
float length [@property getter]

Calculate the length.

Variables

x
T x;

x coordinate

y
T y;

y coordinate

z
T z;

z coordinate

Meta

Authors

rschuett