35namespace LinearAlgebra {
82 inline float Forward()
const {
return z; };
83 inline float Up()
const {
return y; };
84 inline float Right()
const {
return x; };
229using namespace Passer::LinearAlgebra;
231#include "Spherical.h"
An angle in various representations.
Definition Angle.h:21
A spherical vector using angles in various representations.
Definition Spherical.h:18
A 2-dimensional vector.
Definition Vector2.h:38
A 3-dimensional vector.
Definition Vector3.h:42
static const Vector3 back
A normalized back-oriented vector.
Definition Vector3.h:71
static const Vector3 left
A normalized left-oriented vector.
Definition Vector3.h:75
static AngleOf< float > Angle(const Vector3 &v1, const Vector3 &v2)
The angle between two vectors.
Definition Vector3.cpp:187
Vector3()
A new 3-dimensional zero vector.
Definition Vector3.cpp:15
static float Distance(const Vector3 &v1, const Vector3 &v2)
The distance between two vectors.
Definition Vector3.cpp:156
Vector3(SphericalOf< float > v)
Convert vector in spherical coordinates to 3d carthesian coordinates.
bool operator==(const Vector3 &v) const
Check if this vector to the given vector.
Definition Vector3.cpp:152
static const Vector3 one
A vector with one for all axis.
Definition Vector3.h:67
static float Dot(const Vector3 &v1, const Vector3 &v2)
The dot product of two vectors.
Definition Vector3.cpp:148
static float SqrMagnitude(const Vector3 &v)
The squared vector length.
Definition Vector3.cpp:75
static Vector3 Normalize(const Vector3 &v)
Convert the vector to a length of 1.
Definition Vector3.cpp:80
friend Vector3 operator*(const Vector3 &v, float f)
Scale the vector uniformly up.
Definition Vector3.h:149
static Vector3 Lerp(const Vector3 &v1, const Vector3 &v2, float f)
Lerp (linear interpolation) between two vectors.
Definition Vector3.cpp:218
~Vector3()
Vector3 destructor.
Definition Vector3.cpp:52
float magnitude() const
The vector length.
Definition Vector3.cpp:73
Vector3 normalized() const
Convert the vector to a length of 1.
Definition Vector3.cpp:88
Vector3 operator+(const Vector3 &v) const
Add a vector to this vector.
Definition Vector3.cpp:110
static const Vector3 up
A normalized up-oriented vector.
Definition Vector3.h:77
static const Vector3 zero
A vector with zero for all axis.
Definition Vector3.h:65
static Vector3 Cross(const Vector3 &v1, const Vector3 &v2)
The cross product of two vectors.
Definition Vector3.cpp:160
static const Vector3 forward
A normalized forward-oriented vector.
Definition Vector3.h:69
static Vector3 ProjectOnPlane(const Vector3 &v, const Vector3 &n)
Project the vector on a plane defined by a normal orthogonal to the plane.
Definition Vector3.cpp:176
static const Vector3 down
A normalized down-oriented vector.
Definition Vector3.h:79
float sqrMagnitude() const
The squared vector length.
Definition Vector3.cpp:78
Vector3 operator-() const
Negate te vector such that it points in the opposite direction.
Definition Vector3.cpp:97
static float Magnitude(const Vector3 &v)
The vector length.
Definition Vector3.cpp:70
friend Vector3 operator/(const Vector3 &v, float f)
Scale the vector uniformly down.
Definition Vector3.h:161
static Vector3 Project(const Vector3 &v, const Vector3 &n)
Project the vector on another vector.
Definition Vector3.cpp:165
static const Vector3 right
A normalized right-oriented vector.
Definition Vector3.h:73
static AngleOf< float > SignedAngle(const Vector3 &v1, const Vector3 &v2, const Vector3 &axis)
The signed angle between two vectors.
Definition Vector3.cpp:203
static Vector3 Scale(const Vector3 &v1, const Vector3 &v2)
Scale the vector using another vector.
Definition Vector3.cpp:120
3-dimensional Vector representation (C-style)
Definition Vector3.h:16
float x
The right axis of the vector.
Definition Vector3.h:21
float z
The forward axis of the vector.
Definition Vector3.h:29
float y
The upward axis of the vector.
Definition Vector3.h:25