Gin
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
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
 
Vec3operator+= (const Vec3 &other)
 
Vec3operator-= (const Vec3 &other)
 
Vec3operator*= (T scalar)
 
Vec3operator/= (T scalar)
 
Vec3 operator- () const
 
bool operator== (const Vec3 &other) const
 
bool operator!= (const Vec3 &other) const
 
dot (const Vec3 &other) const
 
Vec3 cross (const Vec3 &other) const
 
length () const
 
lengthSquared () const
 
Vec3 normalized () const
 
void normalize ()
 
Vec3 lerp (const Vec3 &other, T t) const
 Linear interpolation between this vector and another.
 

Public Attributes

x = 0
 
y = 0
 
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 ( x_,
y_,
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* ( scalar) const

◆ operator/()

template<typename T >
Vec3 Vec3< T >::operator/ ( 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*= ( scalar)

◆ operator/=()

template<typename T >
Vec3 & Vec3< T >::operator/= ( 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

◆ 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

References Vec3< T >::length().

Referenced by Camera3D::zoom().

◆ normalize()

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

References Vec3< T >::length().

◆ lerp()

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

Linear interpolation between this vector and another.

Member Data Documentation

◆ x

template<typename T >
T Vec3< T >::x = 0

◆ y

template<typename T >
T Vec3< T >::y = 0

◆ z

template<typename T >
T Vec3< T >::z = 0

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