HPC_Voxel_Engine 0.2.0
High-Performance C++ Voxel Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | List of all members
Core::Vec3 Struct Reference

A 3-component vector structure (x, y, z) with standard math operations. More...

#include <src/core/MathUtils.h>

Collaboration diagram for Core::Vec3:
Collaboration graph

Public Member Functions

constexpr Vec3 ()
 
constexpr Vec3 (float _x, float _y, float _z)
 
constexpr Vec3 operator+ (const Vec3 &other) const noexcept
 
constexpr Vec3 operator- (const Vec3 &other) const noexcept
 
constexpr Vec3operator+= (const Vec3 &other) noexcept
 
constexpr Vec3operator-= (const Vec3 &other) noexcept
 
constexpr Vec3 operator* (float scalar) const noexcept
 
constexpr Vec3 operator/ (float scalar) const noexcept
 
float squaredLength () const
 
float length () const
 
Vec3 normalize () const
 
float SquaredDistanceFromPoint (const Core::Vec3 &other) const
 
float DistanceFromPoint (const Core::Vec3 &other) const
 
constexpr float dot (const Vec3 &other) const noexcept
 
constexpr Vec3 cross (const Vec3 &other) const noexcept
 
void print () const
 

Public Attributes

float x
 
float y
 
float z
 

Friends

std::ostream & operator<< (std::ostream &os, const Vec3 &vec)
 

Detailed Description

A 3-component vector structure (x, y, z) with standard math operations.

Constructor & Destructor Documentation

◆ Vec3() [1/2]

constexpr Core::Vec3::Vec3 ( )
inlineconstexpr
Here is the caller graph for this function:

◆ Vec3() [2/2]

constexpr Core::Vec3::Vec3 ( float  _x,
float  _y,
float  _z 
)
inlineconstexpr

Member Function Documentation

◆ cross()

constexpr Vec3 Core::Vec3::cross ( const Vec3 other) const
inlineconstexprnoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DistanceFromPoint()

float Core::Vec3::DistanceFromPoint ( const Core::Vec3 other) const
inline
Here is the call graph for this function:

◆ dot()

constexpr float Core::Vec3::dot ( const Vec3 other) const
inlineconstexprnoexcept
Here is the caller graph for this function:

◆ length()

float Core::Vec3::length ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ normalize()

Vec3 Core::Vec3::normalize ( ) const
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator*()

constexpr Vec3 Core::Vec3::operator* ( float  scalar) const
inlineconstexprnoexcept
Here is the call graph for this function:

◆ operator+()

constexpr Vec3 Core::Vec3::operator+ ( const Vec3 other) const
inlineconstexprnoexcept
Here is the call graph for this function:

◆ operator+=()

constexpr Vec3 & Core::Vec3::operator+= ( const Vec3 other)
inlineconstexprnoexcept

◆ operator-()

constexpr Vec3 Core::Vec3::operator- ( const Vec3 other) const
inlineconstexprnoexcept
Here is the call graph for this function:

◆ operator-=()

constexpr Vec3 & Core::Vec3::operator-= ( const Vec3 other)
inlineconstexprnoexcept

◆ operator/()

constexpr Vec3 Core::Vec3::operator/ ( float  scalar) const
inlineconstexprnoexcept
Here is the call graph for this function:

◆ print()

void Core::Vec3::print ( ) const
inline

◆ SquaredDistanceFromPoint()

float Core::Vec3::SquaredDistanceFromPoint ( const Core::Vec3 other) const
inline
Here is the call graph for this function:

◆ squaredLength()

float Core::Vec3::squaredLength ( ) const
inline
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const Vec3 vec 
)
friend

Member Data Documentation

◆ x

float Core::Vec3::x

◆ y

float Core::Vec3::y

◆ z

float Core::Vec3::z

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