Vector2.hh
Go to the documentation of this file.
543 &operator<<(std::ostream &_out, const Vector2<T> &_pt)
void Max(const Vector2< T > &_v)
Set this vector's components to the maximum of itself and the passed in vector.
Definition: Vector2.hh:198
friend Vector2< T > operator-(const T _s, const Vector2< T > &_v)
Subtraction operators.
Definition: Vector2.hh:337
const Vector2 & operator*=(const Vector2 &_v)
Multiplication assignment operator.
Definition: Vector2.hh:406
const Vector2< T > & operator-=(T _s)
Subtraction assignment operator.
Definition: Vector2.hh:346
T setf(T... args)
const Vector2 & operator=(T _v)
Assignment operator.
Definition: Vector2.hh:241
T & operator[](const std::size_t _index)
Array subscript operator.
Definition: Vector2.hh:483
void Set(T _x, T _y)
Set the contents of the vector.
Definition: Vector2.hh:148
const Vector2 & operator-=(const Vector2 &_v)
Subtraction assignment operator.
Definition: Vector2.hh:316
bool IsFinite() const
See if a point is finite (e.g., not nan)
Definition: Vector2.hh:472
const Vector2 operator*(const Vector2 &_v) const
Multiplication operators.
Definition: Vector2.hh:397
Vector2 Round()
Round to near whole number, return the result.
Definition: Vector2.hh:129
double Distance(const Vector2 &_pt) const
Calc distance to the given point.
Definition: Vector2.hh:84
void Normalize()
Normalize the vector length.
Definition: Vector2.hh:107
const Vector2 & operator+=(const Vector2 &_v)
Addition assignment operator.
Definition: Vector2.hh:260
friend Vector2< T > operator+(const T _s, const Vector2< T > &_v)
Addition operators.
Definition: Vector2.hh:281
T fail(T... args)
Vector2 operator-(const Vector2 &_v) const
Subtraction operator.
Definition: Vector2.hh:308
friend std::istream & operator>>(std::istream &_in, Vector2< T > &_pt)
Stream extraction operator.
Definition: Vector2.hh:563
static const size_t IGN_ONE_SIZE_T
size_t type with a value of 1
Definition: Helpers.hh:230
STL class.
T Dot(const Vector2< T > &_v) const
Get the dot product of this vector and _v.
Definition: Vector2.hh:157
const Vector2 & operator/=(T _v)
Division operator.
Definition: Vector2.hh:386
T min(T... args)
static const Vector2< T > One
math::Vector2(1, 1)
Definition: Vector2.hh:42
T AbsDot(const Vector2< T > &_v) const
Return the absolute dot product of this vector and another vector. This is similar to the Dot functio...
Definition: Vector2.hh:178
Vector2 Normalized() const
Returns a normalized vector.
Definition: Vector2.hh:120
static const Vector2< T > Zero
math::Vector2(0, 0)
Definition: Vector2.hh:39
T operator[](const std::size_t _index) const
Const-qualified array subscript operator.
Definition: Vector2.hh:491
Vector2 Abs() const
Get the absolute value of the vector.
Definition: Vector2.hh:164
static const size_t IGN_ZERO_SIZE_T
size_t type with a value of 0
Definition: Helpers.hh:227
T isfinite(T... args)
bool Equal(const Vector2 &_v, const T &_tol) const
Equality test with tolerance.
Definition: Vector2.hh:448
T max(T... args)
Vector2(const T &_x, const T &_y)
Constructor.
Definition: Vector2.hh:57
T Max() const
Get the maximum value in the vector.
Definition: Vector2.hh:215
void Min(const Vector2< T > &_v)
Set this vector's components to the minimum of itself and the passed in vector.
Definition: Vector2.hh:207
bool operator==(const Vector2 &_v) const
Equal to operator.
Definition: Vector2.hh:458
Vector2 Rounded() const
Get a rounded version of this vector.
Definition: Vector2.hh:138
const Vector2 operator/(const Vector2 &_v) const
Division operator.
Definition: Vector2.hh:358
Vector2< T > operator-(const T _s) const
Subtraction operators.
Definition: Vector2.hh:327
const Vector2 operator/(T _v) const
Division operator.
Definition: Vector2.hh:378
bool operator!=(const Vector2 &_v) const
Not equal to operator.
Definition: Vector2.hh:465
Vector2 operator-() const
Negation operator.
Definition: Vector2.hh:300
T Length() const
Returns the length (magnitude) of the vector.
Definition: Vector2.hh:92
const Vector2< T > & operator+=(const T _s)
Addition assignment operator.
Definition: Vector2.hh:290
Vector2< T > operator+(const T _s) const
Addition operators.
Definition: Vector2.hh:271
const Vector2 & operator/=(const Vector2 &_v)
Division operator.
Definition: Vector2.hh:367
const Vector2 operator*(T _v) const
Multiplication operators.
Definition: Vector2.hh:417
Definition: Angle.hh:42
const Vector2 & operator*=(T _v)
Multiplication assignment operator.
Definition: Vector2.hh:435
Vector2 operator+(const Vector2 &_v) const
Addition operator.
Definition: Vector2.hh:252
Vector2(const Vector2< T > &_v)
Copy constructor.
Definition: Vector2.hh:65
STL class.
static const Vector2 NaN
math::Vector2(NaN, NaN, NaN)
Definition: Vector2.hh:45
T clamp(T _v, T _min, T _max)
Simple clamping function.
Definition: Helpers.hh:406
T SquaredLength() const
Returns the square of the length (magnitude) of the vector.
Definition: Vector2.hh:99
Vector2 & operator=(const Vector2 &_v)
Assignment operator.
Definition: Vector2.hh:230
T Min() const
Get the minimum value in the vector.
Definition: Vector2.hh:222
friend const Vector2 operator*(const T _s, const Vector2 &_v)
Scalar left multiplication operators.
Definition: Vector2.hh:426