cAudio 2.3.0
3d Audio Engine
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
cAudio::cVector3 Class Reference

Class for manipulating vectors in 3D space. More...

#include <cVector3.h>

Public Member Functions

 cVector3 (void)
 Default constructor, initializes everything to 0.
 
 cVector3 (float nx, float ny, float nz)
 
 cVector3 (float n)
 Constructor, initializes all 3 axes to the same value.
 
 cVector3 (const cVector3 &other)
 
 cVector3 (float *vector)
 
cVector3 operator- () const
 
cVector3operator= (const cVector3 &other)
 
cVector3 operator+ (const cVector3 &other) const
 
cVector3operator+= (const cVector3 &other)
 
cVector3 operator+ (const float val) const
 
cVector3operator+= (const float val)
 
cVector3 operator- (const cVector3 &other) const
 
cVector3operator-= (const cVector3 &other)
 
cVector3 operator- (const float val) const
 
cVector3operator-= (const float val)
 
cVector3 operator* (const cVector3 &other) const
 
cVector3operator*= (const cVector3 &other)
 
cVector3 operator* (const float v) const
 
cVector3operator*= (const float v)
 
cVector3 operator/ (const cVector3 &other) const
 
cVector3operator/= (const cVector3 &other)
 
cVector3 operator/ (const float v) const
 
cVector3operator/= (const float v)
 
bool operator<= (const cVector3 &other) const
 
bool operator>= (const cVector3 &other) const
 
bool operator< (const cVector3 &other) const
 
bool operator> (const cVector3 &other) const
 
bool operator== (const cVector3 &other) const
 
bool operator!= (const cVector3 &other) const
 
 operator const float * () const
 
 operator float * ()
 
float operator[] (int i) const
 
float & operator[] (int i)
 
float length () const
 Returns the length (magnitude) of the vector.
 
void normalize ()
 Forces the current vector to have a length of 1 while preserving the ratio of components.
 
float dot (const cVector3 &other) const
 Returns the dot product of this vector with the input vector.
 
cVector3 cross (const cVector3 &other) const
 Returns the cross product of this vector with the input vector.
 
void set (float nx, float ny, float nz)
 Sets the components of this vector.
 
void set (float n)
 Sets all components of this vector to the same number.
 
void set (const cVector3 &other)
 Sets this vector's components to match the input vector's.
 
void getAsArray (float *output)
 

Public Attributes

float x
 
float y
 
float z
 

Detailed Description

Class for manipulating vectors in 3D space.

Definition at line 22 of file cVector3.h.

Constructor & Destructor Documentation

◆ cVector3() [1/5]

cAudio::cVector3::cVector3 ( void  )
inline

Default constructor, initializes everything to 0.

Definition at line 28 of file cVector3.h.

Here is the caller graph for this function:

◆ cVector3() [2/5]

cAudio::cVector3::cVector3 ( float  nx,
float  ny,
float  nz 
)
inline

Definition at line 32 of file cVector3.h.

◆ cVector3() [3/5]

cAudio::cVector3::cVector3 ( float  n)
inline

Constructor, initializes all 3 axes to the same value.

Definition at line 37 of file cVector3.h.

◆ cVector3() [4/5]

cAudio::cVector3::cVector3 ( const cVector3 other)
inline

Definition at line 41 of file cVector3.h.

◆ cVector3() [5/5]

cAudio::cVector3::cVector3 ( float *  vector)
inline

Definition at line 45 of file cVector3.h.

Member Function Documentation

◆ cross()

cVector3 cAudio::cVector3::cross ( const cVector3 other) const
inline

Returns the cross product of this vector with the input vector.

Definition at line 120 of file cVector3.h.

Here is the call graph for this function:

◆ dot()

float cAudio::cVector3::dot ( const cVector3 other) const
inline

Returns the dot product of this vector with the input vector.

Definition at line 114 of file cVector3.h.

◆ getAsArray()

void cAudio::cVector3::getAsArray ( float *  output)
inline

Definition at line 147 of file cVector3.h.

◆ length()

float cAudio::cVector3::length ( ) const
inline

Returns the length (magnitude) of the vector.

Definition at line 99 of file cVector3.h.

Here is the caller graph for this function:

◆ normalize()

void cAudio::cVector3::normalize ( )
inline

Forces the current vector to have a length of 1 while preserving the ratio of components.

Definition at line 105 of file cVector3.h.

Here is the call graph for this function:

◆ operator const float *()

cAudio::cVector3::operator const float * ( ) const
inline

Definition at line 90 of file cVector3.h.

◆ operator float *()

cAudio::cVector3::operator float * ( )
inline

Definition at line 92 of file cVector3.h.

◆ operator!=()

bool cAudio::cVector3::operator!= ( const cVector3 other) const
inline

Definition at line 83 of file cVector3.h.

◆ operator*() [1/2]

cVector3 cAudio::cVector3::operator* ( const cVector3 other) const
inline

Definition at line 61 of file cVector3.h.

◆ operator*() [2/2]

cVector3 cAudio::cVector3::operator* ( const float  v) const
inline

Definition at line 63 of file cVector3.h.

◆ operator*=() [1/2]

cVector3 & cAudio::cVector3::operator*= ( const cVector3 other)
inline

Definition at line 62 of file cVector3.h.

◆ operator*=() [2/2]

cVector3 & cAudio::cVector3::operator*= ( const float  v)
inline

Definition at line 64 of file cVector3.h.

◆ operator+() [1/2]

cVector3 cAudio::cVector3::operator+ ( const cVector3 other) const
inline

Definition at line 51 of file cVector3.h.

◆ operator+() [2/2]

cVector3 cAudio::cVector3::operator+ ( const float  val) const
inline

Definition at line 53 of file cVector3.h.

◆ operator+=() [1/2]

cVector3 & cAudio::cVector3::operator+= ( const cVector3 other)
inline

Definition at line 52 of file cVector3.h.

◆ operator+=() [2/2]

cVector3 & cAudio::cVector3::operator+= ( const float  val)
inline

Definition at line 54 of file cVector3.h.

◆ operator-() [1/3]

cVector3 cAudio::cVector3::operator- ( ) const
inline

Definition at line 49 of file cVector3.h.

◆ operator-() [2/3]

cVector3 cAudio::cVector3::operator- ( const cVector3 other) const
inline

Definition at line 56 of file cVector3.h.

◆ operator-() [3/3]

cVector3 cAudio::cVector3::operator- ( const float  val) const
inline

Definition at line 58 of file cVector3.h.

◆ operator-=() [1/2]

cVector3 & cAudio::cVector3::operator-= ( const cVector3 other)
inline

Definition at line 57 of file cVector3.h.

◆ operator-=() [2/2]

cVector3 & cAudio::cVector3::operator-= ( const float  val)
inline

Definition at line 59 of file cVector3.h.

◆ operator/() [1/2]

cVector3 cAudio::cVector3::operator/ ( const cVector3 other) const
inline

Definition at line 66 of file cVector3.h.

◆ operator/() [2/2]

cVector3 cAudio::cVector3::operator/ ( const float  v) const
inline

Definition at line 68 of file cVector3.h.

◆ operator/=() [1/2]

cVector3 & cAudio::cVector3::operator/= ( const cVector3 other)
inline

Definition at line 67 of file cVector3.h.

◆ operator/=() [2/2]

cVector3 & cAudio::cVector3::operator/= ( const float  v)
inline

Definition at line 69 of file cVector3.h.

◆ operator<()

bool cAudio::cVector3::operator< ( const cVector3 other) const
inline

Definition at line 73 of file cVector3.h.

◆ operator<=()

bool cAudio::cVector3::operator<= ( const cVector3 other) const
inline

Definition at line 71 of file cVector3.h.

◆ operator=()

cVector3 & cAudio::cVector3::operator= ( const cVector3 other)
inline

Definition at line 50 of file cVector3.h.

◆ operator==()

bool cAudio::cVector3::operator== ( const cVector3 other) const
inline

Definition at line 76 of file cVector3.h.

◆ operator>()

bool cAudio::cVector3::operator> ( const cVector3 other) const
inline

Definition at line 74 of file cVector3.h.

◆ operator>=()

bool cAudio::cVector3::operator>= ( const cVector3 other) const
inline

Definition at line 72 of file cVector3.h.

◆ operator[]() [1/2]

float & cAudio::cVector3::operator[] ( int  i)
inline

Definition at line 96 of file cVector3.h.

◆ operator[]() [2/2]

float cAudio::cVector3::operator[] ( int  i) const
inline

Definition at line 94 of file cVector3.h.

◆ set() [1/3]

void cAudio::cVector3::set ( const cVector3 other)
inline

Sets this vector's components to match the input vector's.

Definition at line 140 of file cVector3.h.

◆ set() [2/3]

void cAudio::cVector3::set ( float  n)
inline

Sets all components of this vector to the same number.

Definition at line 134 of file cVector3.h.

◆ set() [3/3]

void cAudio::cVector3::set ( float  nx,
float  ny,
float  nz 
)
inline

Sets the components of this vector.

Definition at line 126 of file cVector3.h.

Member Data Documentation

◆ x

float cAudio::cVector3::x

Definition at line 25 of file cVector3.h.

◆ y

float cAudio::cVector3::y

Definition at line 25 of file cVector3.h.

◆ z

float cAudio::cVector3::z

Definition at line 25 of file cVector3.h.


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