Class Vector3
Defined in File Vector3.h
Class Documentation
-
class Vector3
This class represents a three-dimensional vector.
The three-dimensional vector can be used to represent a translation in three-dimensional space or to represent the attitude of an object using Euler angle.
Public Functions
-
inline Vector3()
Default constructor.
-
inline Vector3(float x, float y, float z)
Constructor.
Constructs a three-dimensional vector from three single values x, y, z or roll, pitch, yaw
-
inline Vector3 &operator=(const Vector3 &other)
Assignment operator.
- Parameters:
other – a vector of dimension 3
-
inline Vector3 cross(const Vector3 &other) const
Three-dimensional vector (cross) product.
Calculates the tree-dimensional cross product, which represents the vector orthogonal to the plane defined by this and other.
- Returns:
this x other
-
inline const float &operator()(unsigned int i) const
-
inline float &operator()(unsigned int i)
-
inline float &x()
-
inline float &y()
-
inline float &z()
-
inline const float &x() const
-
inline const float &y() const
-
inline const float &z() const
-
inline float &roll()
-
inline float &pitch()
-
inline float &yaw()
-
inline const float &roll() const
-
inline const float &pitch() const
-
inline const float &yaw() const
-
inline void operator/=(float x)
-
inline void operator*=(float x)
-
inline double norm() const
- Returns:
length of the vector (“L2 norm”)
-
inline double norm_sq() const
- Returns:
squared length (“L2 norm”) of the vector
-
std::istream &read(std::istream &s)
-
std::ostream &write(std::ostream &s) const
-
std::istream &readBinary(std::istream &s)
-
std::ostream &writeBinary(std::ostream &s) const
Protected Attributes
-
float data[3]
-
inline Vector3()