TeaPacket v0.0.1
Multiplatform Game Engine
Loading...
Searching...
No Matches
TeaPacket::Math::Vector< T, i > Class Template Reference

A template class for all base Vector types. More...

#include <Vector.hpp>

Public Member Functions

T & x ()
 
const T & x () const
 
T & y ()
 
const T & y () const
 
T & z ()
 
const T & z () const
 
T & w ()
 
const T & w () const
 
T & r ()
 
const T & r () const
 
T & g ()
 
const T & g () const
 
T & b ()
 
const T & b () const
 
T & a ()
 
const T & a () const
 
T & u ()
 
const T & u () const
 
T & v ()
 
const T & v () const
 
template<unsigned char s>
Vector< T, i > & operator+= (const Vector< T, s > &other)
 Adds one vector to another.
 
template<unsigned char s>
Vector< T, i > operator+ (const Vector< T, s > &other) const
 
template<unsigned char s>
Vector< T, i > & operator-= (const Vector< T, s > &other)
 Subtracts one vector from another.
 
template<unsigned char s>
Vector< T, i > operator- (const Vector< T, s > &other) const
 
template<unsigned char s>
Vector< T, i > & operator*= (const Vector< T, s > &other)
 Multiplies one vector with another.
 
template<unsigned char s>
Vector< T, i > operator* (const Vector< T, s > &other) const
 
template<unsigned char s>
Vector< T, i > & operator/= (const Vector< T, s > &other)
 Divides one vector from another.
 
template<unsigned char s>
Vector< T, i > operator/ (const Vector< T, s > &other) const
 
template<unsigned char s>
Vector< T, i > & operator%= (const Vector< T, s > &other)
 Modulos one vector from another.
 
template<unsigned char s>
Vector< T, i > operator% (const Vector< T, s > &other) const
 Modulos two vectors.
 
bool operator== (Vector< T, i > const &other) const
 
bool operator!= (Vector< T, i > const &other) const
 
template<typename O, unsigned char s>
 operator Vector< O, s > ()
 Convert a Vector of one type into another type.
 
std::array< T, i > GetAsArray () const
 Get a copy of the Vector as a plain std::array.
 
 operator std::string () const
 Convert the Vector to a string (for printing or serialization purposes)
 
 Vector ()
 Default initializer, setting all values to garbage data.
 
 Vector (std::initializer_list< T > il)
 Initializer list, sets all values to the given values in the list.
 

Detailed Description

template<typename T, unsigned char i>
class TeaPacket::Math::Vector< T, i >

A template class for all base Vector types.

Constructor & Destructor Documentation

◆ Vector() [1/2]

template<typename T, unsigned char i>
TeaPacket::Math::Vector< T, i >::Vector ( )
inline

Default initializer, setting all values to garbage data.

◆ Vector() [2/2]

template<typename T, unsigned char i>
TeaPacket::Math::Vector< T, i >::Vector ( std::initializer_list< T > il)
inline

Initializer list, sets all values to the given values in the list.

Member Function Documentation

◆ a() [1/2]

template<typename T, unsigned char i>
T & TeaPacket::Math::Vector< T, i >::a ( )
inline

◆ a() [2/2]

template<typename T, unsigned char i>
const T & TeaPacket::Math::Vector< T, i >::a ( ) const
inline

◆ b() [1/2]

template<typename T, unsigned char i>
T & TeaPacket::Math::Vector< T, i >::b ( )
inline

◆ b() [2/2]

template<typename T, unsigned char i>
const T & TeaPacket::Math::Vector< T, i >::b ( ) const
inline

◆ g() [1/2]

template<typename T, unsigned char i>
T & TeaPacket::Math::Vector< T, i >::g ( )
inline

◆ g() [2/2]

template<typename T, unsigned char i>
const T & TeaPacket::Math::Vector< T, i >::g ( ) const
inline

◆ GetAsArray()

template<typename T, unsigned char i>
std::array< T, i > TeaPacket::Math::Vector< T, i >::GetAsArray ( ) const
inline

Get a copy of the Vector as a plain std::array.

◆ operator std::string()

template<typename T, unsigned char i>
TeaPacket::Math::Vector< T, i >::operator std::string ( ) const
inline

Convert the Vector to a string (for printing or serialization purposes)

◆ operator Vector< O, s >()

template<typename T, unsigned char i>
template<typename O, unsigned char s>
TeaPacket::Math::Vector< T, i >::operator Vector< O, s > ( )
inline

Convert a Vector of one type into another type.

◆ operator!=()

template<typename T, unsigned char i>
bool TeaPacket::Math::Vector< T, i >::operator!= ( Vector< T, i > const & other) const
inline

Check if two Vectors of the same type do not have equal values.

Parameters
otherThe Vector to compare to this one.
Returns
Whether the two Vectors aren't equal or not.

◆ operator%()

template<typename T, unsigned char i>
template<unsigned char s>
Vector< T, i > TeaPacket::Math::Vector< T, i >::operator% ( const Vector< T, s > & other) const
inline

Modulos two vectors.

◆ operator%=()

template<typename T, unsigned char i>
template<unsigned char s>
Vector< T, i > & TeaPacket::Math::Vector< T, i >::operator%= ( const Vector< T, s > & other)
inline

Modulos one vector from another.

◆ operator*()

template<typename T, unsigned char i>
template<unsigned char s>
Vector< T, i > TeaPacket::Math::Vector< T, i >::operator* ( const Vector< T, s > & other) const
inline

Multiplies two vectors.

◆ operator*=()

template<typename T, unsigned char i>
template<unsigned char s>
Vector< T, i > & TeaPacket::Math::Vector< T, i >::operator*= ( const Vector< T, s > & other)
inline

Multiplies one vector with another.

◆ operator+()

template<typename T, unsigned char i>
template<unsigned char s>
Vector< T, i > TeaPacket::Math::Vector< T, i >::operator+ ( const Vector< T, s > & other) const
inline

Adds two vectors together.

◆ operator+=()

template<typename T, unsigned char i>
template<unsigned char s>
Vector< T, i > & TeaPacket::Math::Vector< T, i >::operator+= ( const Vector< T, s > & other)
inline

Adds one vector to another.

All vector math operations are simply the operations applied on all members of that vector.
For example, addition adds all members together, subtraction subtracts all the 2nd Vector's values from the first Vector's, etc.

◆ operator-()

template<typename T, unsigned char i>
template<unsigned char s>
Vector< T, i > TeaPacket::Math::Vector< T, i >::operator- ( const Vector< T, s > & other) const
inline

Subtracts two vectors.

◆ operator-=()

template<typename T, unsigned char i>
template<unsigned char s>
Vector< T, i > & TeaPacket::Math::Vector< T, i >::operator-= ( const Vector< T, s > & other)
inline

Subtracts one vector from another.

◆ operator/()

template<typename T, unsigned char i>
template<unsigned char s>
Vector< T, i > TeaPacket::Math::Vector< T, i >::operator/ ( const Vector< T, s > & other) const
inline

Divides two vectors.

◆ operator/=()

template<typename T, unsigned char i>
template<unsigned char s>
Vector< T, i > & TeaPacket::Math::Vector< T, i >::operator/= ( const Vector< T, s > & other)
inline

Divides one vector from another.

◆ operator==()

template<typename T, unsigned char i>
bool TeaPacket::Math::Vector< T, i >::operator== ( Vector< T, i > const & other) const
inline

Check if two Vectors of the same type have equal values.

Parameters
otherTHe Vector to compare to this one.
Returns
Whether the two Vectors have equal values.

◆ r() [1/2]

template<typename T, unsigned char i>
T & TeaPacket::Math::Vector< T, i >::r ( )
inline

◆ r() [2/2]

template<typename T, unsigned char i>
const T & TeaPacket::Math::Vector< T, i >::r ( ) const
inline

◆ u() [1/2]

template<typename T, unsigned char i>
T & TeaPacket::Math::Vector< T, i >::u ( )
inline

◆ u() [2/2]

template<typename T, unsigned char i>
const T & TeaPacket::Math::Vector< T, i >::u ( ) const
inline

◆ v() [1/2]

template<typename T, unsigned char i>
T & TeaPacket::Math::Vector< T, i >::v ( )
inline

◆ v() [2/2]

template<typename T, unsigned char i>
const T & TeaPacket::Math::Vector< T, i >::v ( ) const
inline

◆ w() [1/2]

template<typename T, unsigned char i>
T & TeaPacket::Math::Vector< T, i >::w ( )
inline

◆ w() [2/2]

template<typename T, unsigned char i>
const T & TeaPacket::Math::Vector< T, i >::w ( ) const
inline

◆ x() [1/2]

template<typename T, unsigned char i>
T & TeaPacket::Math::Vector< T, i >::x ( )
inline

◆ x() [2/2]

template<typename T, unsigned char i>
const T & TeaPacket::Math::Vector< T, i >::x ( ) const
inline

◆ y() [1/2]

template<typename T, unsigned char i>
T & TeaPacket::Math::Vector< T, i >::y ( )
inline

◆ y() [2/2]

template<typename T, unsigned char i>
const T & TeaPacket::Math::Vector< T, i >::y ( ) const
inline

◆ z() [1/2]

template<typename T, unsigned char i>
T & TeaPacket::Math::Vector< T, i >::z ( )
inline

◆ z() [2/2]

template<typename T, unsigned char i>
const T & TeaPacket::Math::Vector< T, i >::z ( ) const
inline

The documentation for this class was generated from the following file: