Class Vec3

Class Documentation

class Vec3

This class represents a three component vector. It is used for storing positions, velocities, and forces.

Public Functions

inline Vec3()

Create a Vec3 whose elements are all 0.

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

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

inline double operator[](int index) const
inline double &operator[](int index)
inline bool operator==(const Vec3 &rhs) const
inline bool operator!=(const Vec3 &rhs) const
inline Vec3 operator+() const
inline Vec3 operator+(const Vec3 &rhs) const
inline Vec3 &operator+=(const Vec3 &rhs)
inline Vec3 operator-() const
inline Vec3 operator-(const Vec3 &rhs) const
inline Vec3 &operator-=(const Vec3 &rhs)
inline Vec3 operator*(double rhs) const
inline Vec3 &operator*=(double rhs)
inline Vec3 operator/(double rhs) const
inline Vec3 &operator/=(double rhs)
inline double dot(const Vec3 &rhs) const
inline Vec3 cross(const Vec3 &rhs) const