All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Vec3 Class Reference

This class represents a three component vector. More...

`#include <Vec3.h>`

## Public Member Functions

| Vec3 ()
| Create a Vec3 whose elements are all 0. More...
| Vec3 (double x, double y, double z)
| Create a Vec3 with specified x, y, and z components. More...
double | operator[] (int index) const
double & | operator[] (int index)
bool | operator== (const Vec3 &rhs) const
bool | operator!= (const Vec3 &rhs) const
Vec3 | operator+ () const
Vec3 | operator+ (const Vec3 &rhs) const
Vec3 & | operator+= (const Vec3 &rhs)
Vec3 | operator- () const
Vec3 | operator- (const Vec3 &rhs) const
Vec3 & | operator-= (const Vec3 &rhs)
Vec3 | operator* (double rhs) const
Vec3 & | operator*= (double rhs)
Vec3 | operator/ (double rhs) const
Vec3 & | operator/= (double rhs)
double | dot (const Vec3 &rhs) const
Vec3 | cross (const Vec3 &rhs) const

## Detailed Description

This class represents a three component vector.

It is used for storing positions, velocities, and forces.

## Constructor & Destructor Documentation

Vec3 | ( |  | ) |

inline

Create a Vec3 whose elements are all 0.

Referenced by Vec3::cross(), Vec3::operator*(), Vec3::operator+(), Vec3::operator-(), and Vec3::operator/().

Vec3 | ( | double | x,
|  | double | y,
|  | double | z
| ) |  |

inline

Create a Vec3 with specified x, y, and z components.

## Member Function Documentation

Vec3 cross | ( | const Vec3 & | rhs | ) | const

inline

References Vec3::Vec3().

double dot | ( | const Vec3 & | rhs | ) | const

inline

bool operator!= | ( | const Vec3 & | rhs | ) | const

inline

Vec3 operator* | ( | double | rhs | ) | const

inline

References Vec3::Vec3().

Vec3& operator*= | ( | double | rhs | ) |

inline

Vec3 operator+ | ( |  | ) | const

inline

References Vec3::Vec3().

Vec3 operator+ | ( | const Vec3 & | rhs | ) | const

inline

References Vec3::Vec3().

Vec3& operator+= | ( | const Vec3 & | rhs | ) |

inline

Vec3 operator- | ( |  | ) | const

inline

References Vec3::Vec3().

Vec3 operator- | ( | const Vec3 & | rhs | ) | const

inline

References Vec3::Vec3().

Vec3& operator-= | ( | const Vec3 & | rhs | ) |

inline

Vec3 operator/ | ( | double | rhs | ) | const

inline

References Vec3::Vec3().

Vec3& operator/= | ( | double | rhs | ) |

inline

bool operator== | ( | const Vec3 & | rhs | ) | const

inline

double operator[] | ( | int | index | ) | const

inline

double& operator[] | ( | int | index | ) |

inline

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

- Vec3.h