Gin
Loading...
Searching...
No Matches
Vec3< T > Struct Template Reference

A 3D vector class for representing points and directions in 3D space. More...

#include <gin_vec3.h>

Public Member Functions

 Vec3 ()=default
 Vec3 (T x_, T y_, T z_)
Vec3 operator+ (const Vec3 &other) const
Vec3 operator- (const Vec3 &other) const
Vec3 operator* (T scalar) const
Vec3 operator/ (T scalar) const
Vec3 & operator+= (const Vec3 &other)
Vec3 & operator-= (const Vec3 &other)
Vec3 & operator*= (T scalar)
Vec3 & operator/= (T scalar)
Vec3 operator- () const
bool operator== (const Vec3 &other) const
bool operator!= (const Vec3 &other) const
T dot (const Vec3 &other) const
Vec3 cross (const Vec3 &other) const
T length () const
T lengthSquared () const
Vec3 normalized () const
void normalize ()
Vec3 lerp (const Vec3 &other, T t) const
 Linear interpolation between this vector and another.

Public Attributes

T x = 0
T y = 0
T z = 0

Detailed Description

template<typename T>
struct Vec3< T >

A 3D vector class for representing points and directions in 3D space.

Constructor & Destructor Documentation

◆ Vec3() [1/2]

template<typename T>
Vec3< T >::Vec3 ( )
default

◆ Vec3() [2/2]

template<typename T>
Vec3< T >::Vec3 ( T x_,
T y_,
T z_ )

Member Function Documentation

◆ operator+()

template<typename T>
Vec3 Vec3< T >::operator+ ( const Vec3< T > & other) const

◆ operator-() [1/2]

template<typename T>
Vec3 Vec3< T >::operator- ( const Vec3< T > & other) const

◆ operator*()

template<typename T>
Vec3 Vec3< T >::operator* ( T scalar) const

◆ operator/()

template<typename T>
Vec3 Vec3< T >::operator/ ( T scalar) const

◆ operator+=()

template<typename T>
Vec3 & Vec3< T >::operator+= ( const Vec3< T > & other)

◆ operator-=()

template<typename T>
Vec3 & Vec3< T >::operator-= ( const Vec3< T > & other)

◆ operator*=()

template<typename T>
Vec3 & Vec3< T >::operator*= ( T scalar)

◆ operator/=()

template<typename T>
Vec3 & Vec3< T >::operator/= ( T scalar)

◆ operator-() [2/2]

template<typename T>
Vec3 Vec3< T >::operator- ( ) const

◆ operator==()

template<typename T>
bool Vec3< T >::operator== ( const Vec3< T > & other) const

◆ operator!=()

template<typename T>
bool Vec3< T >::operator!= ( const Vec3< T > & other) const

◆ dot()

template<typename T>
T Vec3< T >::dot ( const Vec3< T > & other) const

Referenced by Mat4< float >::lookAt().

◆ cross()

template<typename T>
Vec3 Vec3< T >::cross ( const Vec3< T > & other) const

◆ length()

template<typename T>
T Vec3< T >::length ( ) const

◆ lengthSquared()

template<typename T>
T Vec3< T >::lengthSquared ( ) const

◆ normalized()

template<typename T>
Vec3 Vec3< T >::normalized ( ) const

◆ normalize()

template<typename T>
void Vec3< T >::normalize ( )

◆ lerp()

template<typename T>
Vec3 Vec3< T >::lerp ( const Vec3< T > & other,
T t ) const

Linear interpolation between this vector and another.

Member Data Documentation

◆ x

◆ y

◆ z


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