Audaspace 1.5.0
A high level audio library.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Vector3 Class Reference

This class represents a 3 dimensional vector. More...

#include <Math3D.h>

Public Member Functions

 Vector3 (float x=0, float y=0, float z=0)
 Creates a new 3 dimensional vector.
 
const float & x () const
 Retrieves the x component of the vector.
 
const float & y () const
 Retrieves the y component of the vector.
 
const float & z () const
 Retrieves the z component of the vector.
 
void get (float *destination) const
 Retrieves the components of the vector.
 
float * get ()
 Retrieves the components of the vector.
 
const float * get () const
 Retrieves the components of the vector.
 
float length () const
 Retrieves the length of the vector.
 
Vector3 cross (const Vector3 &op) const
 Retrieves the cross product.
 
float operator* (const Vector3 &op) const
 Retrieves the dot product.
 
Vector3 operator* (const float &op) const
 Retrieves the product with a scalar.
 
Vector3 operator+ (const Vector3 &op) const
 Adds two vectors.
 
Vector3 operator- (const Vector3 &op) const
 Subtracts two vectors.
 
Vector3 operator- () const
 Negates the vector.
 
Vector3operator-= (const Vector3 &op)
 Subtracts the second vector.
 

Detailed Description

This class represents a 3 dimensional vector.

Constructor & Destructor Documentation

◆ Vector3()

Vector3::Vector3 ( float x = 0,
float y = 0,
float z = 0 )
inline

Creates a new 3 dimensional vector.

Parameters
xThe x component.
yThe y component.
zThe z component.

Member Function Documentation

◆ cross()

Vector3 Vector3::cross ( const Vector3 & op) const
inline

Retrieves the cross product.

Parameters
opThe second operand.
Returns
The cross product of the two vectors.

◆ get() [1/3]

float * Vector3::get ( )
inline

Retrieves the components of the vector.

Returns
The components as float[3].

◆ get() [2/3]

const float * Vector3::get ( ) const
inline

Retrieves the components of the vector.

Returns
The components as float[3].

◆ get() [3/3]

void Vector3::get ( float * destination) const
inline

Retrieves the components of the vector.

Parameters
destinationWhere the 3 float values should be saved to.

◆ length()

float Vector3::length ( ) const
inline

Retrieves the length of the vector.

Returns
The length of the vector.

◆ operator*() [1/2]

Vector3 Vector3::operator* ( const float & op) const
inline

Retrieves the product with a scalar.

Parameters
opThe second operand.
Returns
The scaled vector.

◆ operator*() [2/2]

float Vector3::operator* ( const Vector3 & op) const
inline

Retrieves the dot product.

Parameters
opThe second operand.
Returns
The dot product of the two vectors.

◆ operator+()

Vector3 Vector3::operator+ ( const Vector3 & op) const
inline

Adds two vectors.

Parameters
opThe second operand.
Returns
The sum vector.

◆ operator-() [1/2]

Vector3 Vector3::operator- ( ) const
inline

Negates the vector.

Returns
The vector facing in the opposite direction.

◆ operator-() [2/2]

Vector3 Vector3::operator- ( const Vector3 & op) const
inline

Subtracts two vectors.

Parameters
opThe second operand.
Returns
The difference vector.

◆ operator-=()

Vector3 & Vector3::operator-= ( const Vector3 & op)
inline

Subtracts the second vector.

Parameters
opThe second operand.
Returns
The difference vector.

◆ x()

const float & Vector3::x ( ) const
inline

Retrieves the x component of the vector.

Returns
The x component.

◆ y()

const float & Vector3::y ( ) const
inline

Retrieves the y component of the vector.

Returns
The y component.

◆ z()

const float & Vector3::z ( ) const
inline

Retrieves the z component of the vector.

Returns
The z component.

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