SDL Breakout Engine  0.1.0
An implementation of a Breakout game using sdl, implemented with efficient resource management.
Public Member Functions | List of all members
Vector3D Struct Reference

#include <TinyMath.hpp>

Public Member Functions

 Vector3D () = default
 Default constructor. More...
 
 Vector3D (float a, float b, float c)
 
float & operator[] (int i)
 
const float & operator[] (int i) const
 
Vector3D & operator*= (float s)
 
Vector3D & operator/= (float s)
 
Vector3D & operator+= (const Vector3D &v)
 
Vector3D & operator-= (const Vector3D &v)
 
bool operator== (const Vector3D &other)
 
bool equals (const Vector3D &other, float tolerance)
 

Public Attributes

float x
 
float y
 
float z
 

Detailed Description

Vector3D performs vector operations with 3-dimensions The purpose of this class is primarily for 3D graphics applications.

Constructor & Destructor Documentation

Vector3D::Vector3D ( )
default

Default constructor.

Vector3D::Vector3D ( float  a,
float  b,
float  c 
)
inline

Initialize a 3D Vector

Parameters
ax
by
cz

Member Function Documentation

bool Vector3D::equals ( const Vector3D &  other,
float  tolerance 
)
inline

return tolerant equality

Parameters
otherother vector
toleranceallowed tolerance of equality
Vector3D& Vector3D::operator*= ( float  s)
inline

Multiplication Operator Multiply vector by a uniform-scalar.

Parameters
sscalar multiplier
Vector3D& Vector3D::operator+= ( const Vector3D &  v)
inline

Addition operator Add the given vectors components to this vector.

Parameters
vwhat to add
Vector3D& Vector3D::operator-= ( const Vector3D &  v)
inline

Subtraction operator Substract the given vector's components from this vector.

Parameters
vwhat to subtract
Vector3D& Vector3D::operator/= ( float  s)
inline

Division Operator

Parameters
sscalar multiplier
bool Vector3D::operator== ( const Vector3D &  other)
inline

return exact equality

Parameters
otherother vector
float& Vector3D::operator[] ( int  i)
inline

Index operator, allowing us to access the individual x,y,z components of our vector.

Parameters
iElement to access
const float& Vector3D::operator[] ( int  i) const
inline

Index operator, allowing us to access the individual x,y,z components of our vector.

Parameters
iElement to access

Member Data Documentation

float Vector3D::x

Represents the x,y,z components of a vector in 3D space, respectively.

float Vector3D::y
float Vector3D::z

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