Vector3.hh
Go to the documentation of this file.
Vector3< T > operator*(const Vector3< T > &_p) const
Multiplication operator.
Definition: Vector3.hh:503
const Vector3 & operator+=(const Vector3< T > &_v)
Addition assignment operator.
Definition: Vector3.hh:349
T setf(T... args)
Vector3 operator+(const Vector3< T > &_v) const
Addition operator.
Definition: Vector3.hh:339
Vector3 Round()
Round to near whole number, return the result.
Definition: Vector3.hh:158
void Set(T _x=0, T _y=0, T _z=0)
Set the contents of the vector.
Definition: Vector3.hh:179
friend Vector3< T > operator-(const T _s, const Vector3< T > &_v)
Subtraction operators.
Definition: Vector3.hh:433
T precision(const T &_a, const unsigned int &_precision)
get value at a specified precision
Definition: Helpers.hh:589
static Vector3 Normal(const Vector3< T > &_v1, const Vector3< T > &_v2, const Vector3< T > &_v3)
Get a normal vector to a triangle.
Definition: Vector3.hh:252
static const Vector3 UnitZ
math::Vector3(0, 0, 1)
Definition: Vector3.hh:55
bool Equal(const Vector3 &_v, const T &_tol) const
Equality test with tolerance.
Definition: Vector3.hh:559
Vector3< T > operator-(const Vector3< T > &_pt) const
Subtraction operators.
Definition: Vector3.hh:400
const Vector3< T > & operator-=(const T _s)
Subtraction assignment operator.
Definition: Vector3.hh:442
bool operator==(const Vector3< T > &_v) const
Equal to operator.
Definition: Vector3.hh:570
T Min() const
Get the minimum value in the vector.
Definition: Vector3.hh:307
T AbsDot(const Vector3< T > &_v) const
Return the absolute dot product of this vector and another vector. This is similar to the Dot functio...
Definition: Vector3.hh:214
T Distance(const Vector3< T > &_pt) const
Calc distance to the given point.
Definition: Vector3.hh:98
STL class.
static const Vector3 UnitY
math::Vector3(0, 1, 0)
Definition: Vector3.hh:52
Vector3 Perpendicular() const
Return a vector that is perpendicular to this one.
Definition: Vector3.hh:232
T min(T... args)
Vector3 operator-() const
Negation operator.
Definition: Vector3.hh:392
Vector3 Normalized() const
Return a normalized vector.
Definition: Vector3.hh:149
Vector3 Abs() const
Get the absolute value of the vector.
Definition: Vector3.hh:223
void Max(const Vector3< T > &_v)
Set this vector's components to the maximum of itself and the passed in vector.
Definition: Vector3.hh:275
bool operator!=(const Vector3< T > &_v) const
Not equal to operator.
Definition: Vector3.hh:579
T Dot(const Vector3< T > &_v) const
Return the dot product of this vector and another vector.
Definition: Vector3.hh:199
Vector3 Cross(const Vector3< T > &_v) const
Return the cross product of this vector with another vector.
Definition: Vector3.hh:189
const Vector3< T > operator/(T _v) const
Division operator.
Definition: Vector3.hh:479
Vector3 Rounded() const
Get a rounded version of this vector.
Definition: Vector3.hh:168
friend Vector3< T > operator+(const T _s, const Vector3< T > &_v)
Addition operators.
Definition: Vector3.hh:372
const Vector3< T > & operator+=(const T _s)
Addition assignment operator.
Definition: Vector3.hh:381
static const size_t IGN_ZERO_SIZE_T
size_t type with a value of 0
Definition: Helpers.hh:226
T isfinite(T... args)
friend std::istream & operator>>(std::istream &_in, Vector3< T > &_pt)
Stream extraction operator.
Definition: Vector3.hh:735
Vector3< T > operator-(const T _s) const
Subtraction operators.
Definition: Vector3.hh:422
T max(T... args)
const Vector3< T > operator/(const Vector3< T > &_pt) const
Division operator.
Definition: Vector3.hh:455
Vector3 Normalize()
Normalize the vector length.
Definition: Vector3.hh:133
T SquaredLength() const
Return the square of the length (magnitude) of the vector.
Definition: Vector3.hh:124
T Length() const
Returns the length (magnitude) of the vector.
Definition: Vector3.hh:117
The Vector3 class represents the generic vector containing 3 elements. Since it's commonly used to ke...
Definition: Vector3.hh:40
const Vector3< T > & operator*=(const Vector3< T > &_v)
Multiplication assignment operators.
Definition: Vector3.hh:514
static const Vector3 One
math::Vector3(1, 1, 1)
Definition: Vector3.hh:46
Vector3 & operator=(const Vector3< T > &_v)
Assignment operator.
Definition: Vector3.hh:315
T & operator[](const std::size_t _index)
Array subscript operator.
Definition: Vector3.hh:612
T pow(T... args)
const Vector3< T > & operator*=(T _v)
Multiplication operator.
Definition: Vector3.hh:545
Vector3(const Vector3< T > &_v)
Copy constructor.
Definition: Vector3.hh:78
static const size_t IGN_TWO_SIZE_T
size_t type with a value of 2
Definition: Helpers.hh:232
Vector3 & operator=(T _v)
Assignment operator.
Definition: Vector3.hh:327
T Max() const
Get the maximum value in the vector.
Definition: Vector3.hh:300
static const Vector3 UnitX
math::Vector3(1, 0, 0)
Definition: Vector3.hh:49
Vector3(const T &_x, const T &_y, const T &_z)
Constructor.
Definition: Vector3.hh:69
void Min(const Vector3< T > &_v)
Set this vector's components to the minimum of itself and the passed in vector.
Definition: Vector3.hh:288
T operator[](const std::size_t _index) const
Const-qualified array subscript operator.
Definition: Vector3.hh:621
static const Vector3 Zero
math::Vector3(0, 0, 0)
Definition: Vector3.hh:43
Definition: Angle.hh:42
const Vector3< T > & operator/=(T _v)
Division assignment operator.
Definition: Vector3.hh:490
const Vector3< T > & operator/=(const Vector3< T > &_pt)
Division assignment operator.
Definition: Vector3.hh:466
const Vector3< T > & operator-=(const Vector3< T > &_pt)
Subtraction assignment operators.
Definition: Vector3.hh:410
STL class.
T DistToLine(const Vector3< T > &_pt1, const Vector3 &_pt2)
Get distance to a line.
Definition: Vector3.hh:265
void Round(int _precision)
Round all values to _precision decimal places.
Definition: Vector3.hh:628
Vector3< T > operator+(const T _s) const
Addition operators.
Definition: Vector3.hh:361
bool Equal(const Vector3< T > &_v) const
Equality test.
Definition: Vector3.hh:639
T clamp(T _v, T _min, T _max)
Simple clamping function.
Definition: Helpers.hh:405
friend std::ostream & operator<<(std::ostream &_out, const Vector3< T > &_pt)
Stream insertion operator.
Definition: Vector3.hh:723
T Distance(T _x, T _y, T _z) const
Calc distance to the given point.
Definition: Vector3.hh:110
Vector3< T > operator*(T _s) const
Multiplication operators.
Definition: Vector3.hh:526
bool IsFinite() const
See if a point is finite (e.g., not nan)
Definition: Vector3.hh:586
friend Vector3< T > operator*(T _s, const Vector3< T > &_v)
Multiplication operators.
Definition: Vector3.hh:537