Libftpp
A modern C++ library
IVector2< TType > Struct Template Reference

#include <ivector2.hpp>

Public Member Functions

 IVector2 ()
 
 IVector2 (TType x, TType y)
 
IVector2 operator+ (const IVector2 &other) const
 
IVector2 operator- (const IVector2 &other) const
 
IVector2 operator* (const IVector2 &other) const
 
IVector2 operator/ (const IVector2 &other) const
 
bool operator== (const IVector2 &other) const
 
bool operator!= (const IVector2 &other) const
 
IVector2operator+= (const IVector2 &other)
 
IVector2operator-= (const IVector2 &other)
 
float length () const
 
IVector2< TType > normalize ()
 
float dot ()
 
float dot (const IVector2 &other)
 
IVector2 cross ()
 
float cross (const IVector2 &other) const
 

Public Attributes

TType x
 
TType y
 

Detailed Description

template<typename TType>
struct IVector2< TType >

Definition at line 8 of file ivector2.hpp.

Constructor & Destructor Documentation

◆ IVector2() [1/2]

◆ IVector2() [2/2]

template<typename TType >
IVector2< TType >::IVector2 ( TType  x,
TType  y 
)
inline

Definition at line 14 of file ivector2.hpp.

Member Function Documentation

◆ cross() [1/2]

template<typename TType >
IVector2 IVector2< TType >::cross ( )
inline

◆ cross() [2/2]

template<typename TType >
float IVector2< TType >::cross ( const IVector2< TType > &  other) const
inline

Definition at line 97 of file ivector2.hpp.

References IVector2< TType >::x, and IVector2< TType >::y.

◆ dot() [1/2]

template<typename TType >
float IVector2< TType >::dot ( )
inline

Definition at line 77 of file ivector2.hpp.

References IVector2< TType >::x, and IVector2< TType >::y.

Referenced by PerlinNoise2D::sample().

◆ dot() [2/2]

template<typename TType >
float IVector2< TType >::dot ( const IVector2< TType > &  other)
inline

Definition at line 82 of file ivector2.hpp.

References IVector2< TType >::x, and IVector2< TType >::y.

◆ length()

template<typename TType >
float IVector2< TType >::length ( ) const
inline

Definition at line 62 of file ivector2.hpp.

References IVector2< TType >::x, and IVector2< TType >::y.

Referenced by IVector2< TType >::normalize().

◆ normalize()

template<typename TType >
IVector2<TType> IVector2< TType >::normalize ( )
inline

◆ operator!=()

template<typename TType >
bool IVector2< TType >::operator!= ( const IVector2< TType > &  other) const
inline

Definition at line 43 of file ivector2.hpp.

◆ operator*()

template<typename TType >
IVector2 IVector2< TType >::operator* ( const IVector2< TType > &  other) const
inline

◆ operator+()

template<typename TType >
IVector2 IVector2< TType >::operator+ ( const IVector2< TType > &  other) const
inline

◆ operator+=()

template<typename TType >
IVector2& IVector2< TType >::operator+= ( const IVector2< TType > &  other)
inline

Definition at line 49 of file ivector2.hpp.

References IVector2< TType >::x, and IVector2< TType >::y.

◆ operator-()

template<typename TType >
IVector2 IVector2< TType >::operator- ( const IVector2< TType > &  other) const
inline

◆ operator-=()

template<typename TType >
IVector2& IVector2< TType >::operator-= ( const IVector2< TType > &  other)
inline

Definition at line 55 of file ivector2.hpp.

References IVector2< TType >::x, and IVector2< TType >::y.

◆ operator/()

template<typename TType >
IVector2 IVector2< TType >::operator/ ( const IVector2< TType > &  other) const
inline

◆ operator==()

template<typename TType >
bool IVector2< TType >::operator== ( const IVector2< TType > &  other) const
inline

Definition at line 38 of file ivector2.hpp.

References IVector2< TType >::x, and IVector2< TType >::y.

Member Data Documentation

◆ x

◆ y