Golias Engine
A C++ 20 'game engine' built with SDL3 with wide platform support.
Public Member Functions | Static Public Attributes | List of all members
Vector3 Class Reference

#include <vector3.h>

Inheritance diagram for Vector3:

Public Member Functions

 Vector3 ()
 
 Vector3 (float x, float y, float z)
 
 Vector3 (float v)
 
 Vector3 (const glm::vec3 &v)
 
float & operator[] (int index)
 
const float & operator[] (int index) const
 
float length () const
 
Vector3 normalized () const
 
void normalize ()
 
float dot (const Vector3 &other) const
 
Vector3 cross (const Vector3 &other) const
 
float distance_to (const Vector3 &other) const
 
Vector3 lerp (const Vector3 &other, float t) const
 
Vector3 reflect (const Vector3 &normal) const
 
Vector3 refract (const Vector3 &normal, float eta) const
 
Vector3 abs () const
 
Vector3 sign () const
 
Vector3 floor () const
 
Vector3 ceil () const
 
Vector3 round () const
 
bool is_zero_approx () const
 

Static Public Attributes

static const Vector3 ZERO = Vector3(0.0f, 0.0f, 0.0f)
 
static const Vector3 ONE = Vector3(1.0f, 1.0f, 1.0f)
 
static const Vector3 LEFT = Vector3(-1.0f, 0.0f, 0.0f)
 
static const Vector3 RIGHT = Vector3(1.0f, 0.0f, 0.0f)
 
static const Vector3 UP = Vector3(0.0f, 1.0f, 0.0f)
 
static const Vector3 DOWN = Vector3(0.0f, -1.0f, 0.0f)
 
static const Vector3 FORWARD = Vector3(0.0f, 0.0f, -1.0f)
 
static const Vector3 BACK = Vector3(0.0f, 0.0f, 1.0f)
 

Constructor & Destructor Documentation

◆ Vector3() [1/4]

Vector3::Vector3 ( )

◆ Vector3() [2/4]

Vector3::Vector3 ( float  x,
float  y,
float  z 
)

◆ Vector3() [3/4]

Vector3::Vector3 ( float  v)

◆ Vector3() [4/4]

Vector3::Vector3 ( const glm::vec3 &  v)

Member Function Documentation

◆ abs()

Vector3 Vector3::abs ( ) const

◆ ceil()

Vector3 Vector3::ceil ( ) const

◆ cross()

Vector3 Vector3::cross ( const Vector3 other) const

◆ distance_to()

float Vector3::distance_to ( const Vector3 other) const

◆ dot()

float Vector3::dot ( const Vector3 other) const

◆ floor()

Vector3 Vector3::floor ( ) const

◆ is_zero_approx()

bool Vector3::is_zero_approx ( ) const

◆ length()

float Vector3::length ( ) const

◆ lerp()

Vector3 Vector3::lerp ( const Vector3 other,
float  t 
) const

◆ normalize()

void Vector3::normalize ( )

◆ normalized()

Vector3 Vector3::normalized ( ) const

◆ operator[]() [1/2]

float & Vector3::operator[] ( int  index)

◆ operator[]() [2/2]

const float & Vector3::operator[] ( int  index) const

◆ reflect()

Vector3 Vector3::reflect ( const Vector3 normal) const

◆ refract()

Vector3 Vector3::refract ( const Vector3 normal,
float  eta 
) const

◆ round()

Vector3 Vector3::round ( ) const

◆ sign()

Vector3 Vector3::sign ( ) const

Member Data Documentation

◆ BACK

const Vector3 Vector3::BACK = Vector3(0.0f, 0.0f, 1.0f)
static

◆ DOWN

const Vector3 Vector3::DOWN = Vector3(0.0f, -1.0f, 0.0f)
static

◆ FORWARD

const Vector3 Vector3::FORWARD = Vector3(0.0f, 0.0f, -1.0f)
static

◆ LEFT

const Vector3 Vector3::LEFT = Vector3(-1.0f, 0.0f, 0.0f)
static

◆ ONE

const Vector3 Vector3::ONE = Vector3(1.0f, 1.0f, 1.0f)
static

◆ RIGHT

const Vector3 Vector3::RIGHT = Vector3(1.0f, 0.0f, 0.0f)
static

◆ UP

const Vector3 Vector3::UP = Vector3(0.0f, 1.0f, 0.0f)
static

◆ ZERO

const Vector3 Vector3::ZERO = Vector3(0.0f, 0.0f, 0.0f)
static

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