Mineserver
A rewrite of Minecraft 1.8.9 in C++ !
Loading...
Searching...
No Matches
Vec< T > Class Template Reference

Vector 3 (x, y, z) with variable type. More...

#include <vector.hpp>

Public Member Functions

 Vec ()
 Construct a new Vec object.
 
 Vec (T x, T y)
 Construct a new Vec object.
 
 Vec (T x, T y, T z)
 Construct a new Vec object.
 
 ~Vec ()=default
 Destroy the Vec object.
 
template<typename O >
 Vec (const Vec< O > &other)
 Construct a new Vec object from another.
 
template<typename O >
Vecoperator+ (const Vec< O > &other)
 Vector Addition operator.
 
template<typename O >
Vecoperator- (const Vec< O > &other)
 Vector Substraction operator.
 
template<typename O >
Vecoperator* (const Vec< O > &other)
 Vector Multiplication operator.
 
template<typename O >
Vecoperator/ (const Vec< O > &other)
 Vector Division operator.
 
template<typename O >
Vecoperator* (const O &other)
 Scalar Multiplication operator.
 
template<typename O >
Vecoperator/ (const O &other)
 Scalar Division operator.
 

Public Attributes

T x
 X coordinate.
 
T y
 Y coordinate.
 
T z
 Z coordinate.
 

Detailed Description

template<typename T>
class Vec< T >

Vector 3 (x, y, z) with variable type.

Template Parameters
Tthe type to use for x, y, z coordinates

Constructor & Destructor Documentation

◆ Vec() [1/4]

template<typename T >
Vec< T >::Vec ( )
inline

Construct a new Vec object.

All coordinates are set as 0.

◆ Vec() [2/4]

template<typename T >
Vec< T >::Vec ( T x,
T y )
inline

Construct a new Vec object.

The z coordinate is set to 0.

Parameters
xthe x coordinate
ythe y coordinate

◆ Vec() [3/4]

template<typename T >
Vec< T >::Vec ( T x,
T y,
T z )
inline

Construct a new Vec object.

Parameters
xthe x coordinate
ythe y coordinate
zthe z coordinate

◆ Vec() [4/4]

template<typename T >
template<typename O >
Vec< T >::Vec ( const Vec< O > & other)
inline

Construct a new Vec object from another.

Template Parameters
Othe type of the other vector
Parameters
otherthe other vector

Member Function Documentation

◆ operator*() [1/2]

template<typename T >
template<typename O >
Vec & Vec< T >::operator* ( const O & other)
inline

Scalar Multiplication operator.

Template Parameters
Othe type of the scalar (should be arithmetic type)
Parameters
otherthe other scalar
Returns
Vec& the returned vector

◆ operator*() [2/2]

template<typename T >
template<typename O >
Vec & Vec< T >::operator* ( const Vec< O > & other)
inline

Vector Multiplication operator.

Template Parameters
Othe type of the other vector
Parameters
otherthe other vector
Returns
Vec& the returned vector

◆ operator+()

template<typename T >
template<typename O >
Vec & Vec< T >::operator+ ( const Vec< O > & other)
inline

Vector Addition operator.

Template Parameters
Othe type of the other vector
Parameters
otherthe other vector
Returns
Vec& the returned vector

◆ operator-()

template<typename T >
template<typename O >
Vec & Vec< T >::operator- ( const Vec< O > & other)
inline

Vector Substraction operator.

Template Parameters
Othe type of the other vector
Parameters
otherthe other vector
Returns
Vec& the returned vector

◆ operator/() [1/2]

template<typename T >
template<typename O >
Vec & Vec< T >::operator/ ( const O & other)
inline

Scalar Division operator.

Template Parameters
Othe type of the scalar (should be arithmetic type)
Parameters
otherthe other scalar
Returns
Vec& the returned vector

◆ operator/() [2/2]

template<typename T >
template<typename O >
Vec & Vec< T >::operator/ ( const Vec< O > & other)
inline

Vector Division operator.

Template Parameters
Othe type of the other vector
Parameters
otherthe other vector
Returns
Vec& the returned vector

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