3-dimensional Vector representation
Definition Vector3.h:14
float x
The right axis of the vector.
Definition Vector3.h:18
float z
The forward axis of the vector.
Definition Vector3.h:26
float y
The upward axis of the vector.
Definition Vector3.h:22
A 3-dimensional vector.
Definition Vector3.h:35
static Vector3 Project(Vector3 vector, Vector3 onNormal)
Project a vector on another vector.
Definition Vector3.cpp:113
static const Vector3 back
A vector with values (0, 0, -1)
Definition Vector3.h:86
static const Vector3 left
A vector3 with values (-1, 0, 0)
Definition Vector3.h:70
Vector3()
Create a new 3-dimensinal zero vector.
Definition Vector3.cpp:12
Vector3 operator+(const Vector3 &vector2) const
Add another vector to this vector.
Definition Vector3.cpp:81
static float Magnitude(const Vector3 &vector)
The length of a vector.
Definition Vector3.cpp:42
static float Dot(const Vector3 &vector1, const Vector3 &vector2)
The dot product of two vectors.
Definition Vector3.cpp:97
Vector3 operator/(const float &factor)
Scale a vector uniformy down.
Definition Vector3.cpp:93
static const Vector3 one
A vector with one for all axis.
Definition Vector3.h:62
bool operator==(const Vector3 &vector)
Check is this vector is equal to the given vector.
Definition Vector3.cpp:101
~Vector3()
Definition Vector3.cpp:30
float magnitude() const
The length of this vector.
Definition Vector3.cpp:45
static Vector3 Cross(const Vector3 &vector1, const Vector3 &vector2)
The cross product of two vectors.
Definition Vector3.cpp:109
Vector3 normalized() const
Convert the vector to a length of a.
Definition Vector3.cpp:64
static const Vector3 up
A vector with values (0, 1, 0)
Definition Vector3.h:74
static const Vector3 zero
A vector with zero for all axis.
Definition Vector3.h:58
static Vector3 Normalize(Vector3 vector)
Connvert a vector to a length of 1.
Definition Vector3.cpp:56
static const Vector3 forward
A vector with values (0, 0, 1)
Definition Vector3.h:82
static Vector3 Lerp(Vector3 from, Vector3 to, float f)
Lerp between two vectors.
Definition Vector3.cpp:165
Vector3 operator-()
Negate the vector.
Definition Vector3.cpp:77
static const Vector3 down
A vector with values (0, -1, 0)
Definition Vector3.h:78
float sqrMagnitude() const
The squared length of this vector.
Definition Vector3.cpp:52
Vector3 operator*(float factor) const
Scale a vector uniformly up.
Definition Vector3.cpp:89
static Vector3 Scale(const Vector3 &vector1, const Vector3 &vector2)
Scale a vector using another vector.
Definition Vector3.cpp:85
static float Distance(const Vector3 &vector1, const Vector3 &vector2)
The distance between two vectors.
Definition Vector3.cpp:105
static float SqrMagnitude(const Vector3 &vector)
The squared length of a vector.
Definition Vector3.cpp:49
static float SignedAngle(Vector3 from, Vector3 to, Vector3 axis)
Calculate the angle between two vectors rotation around an axis.
Definition Vector3.cpp:150
static Vector3 ProjectOnPlane(Vector3 vector, Vector3 planeNormal)
Projects a vector onto a plane defined by a normal orthogonal to the plane.
Definition Vector3.cpp:124
static const Vector3 right
A vector with values (1, 0, 0)
Definition Vector3.h:66