Type for 3D vectors of floating point numbers. More...
#include <AH/Math/Vector.hpp>
 Collaboration diagram for Vec3f:Public Member Functions | |
| Vec3f ()=default | |
| Create a vector that is initialized to the zero vector (0,0,0).  More... | |
| Vec3f (float x, float y, float z) | |
| Create a vector with the given x, y and z coordinates.  More... | |
| Vec3f (const Vec3f &)=default | |
| Vec3f (const volatile Vec3f &other) | |
| void | operator= (const Vec3f &other) volatile | 
| Vec3f & | operator+= (Vec3f rhs) | 
| Addition.  More... | |
| Vec3f | operator+ (Vec3f rhs) const | 
| Addition.  More... | |
| Vec3f | operator- () const | 
| Negation.  More... | |
| Vec3f & | operator-= (Vec3f rhs) | 
| Subtraction.  More... | |
| Vec3f | operator- (Vec3f rhs) const | 
| Subtraction.  More... | |
| Vec3f & | operator*= (float rhs) | 
| Scalar multiplication.  More... | |
| Vec3f | operator* (float rhs) const | 
| Scalar multiplication.  More... | |
| Vec3f & | operator/= (float rhs) | 
| Scalar division.  More... | |
| Vec3f | operator/ (float rhs) const | 
| Scalar division.  More... | |
| float | operator* (Vec3f rhs) const | 
| Inner product.  More... | |
| float | normSquared () const | 
| Norm squared.  More... | |
| float | norm () const | 
| Norm.  More... | |
| Vec3f & | normalize () | 
| Normalize this vector.  More... | |
| Vec3f | normalized () const | 
| Normalize a copy of this vector (doesn't change the original vector).  More... | |
| bool | operator== (Vec3f rhs) const | 
| Equality check.  More... | |
| bool | operator!= (Vec3f rhs) const | 
| Inequality check.  More... | |
Public Attributes | |
| float | x = 0.0 | 
| The x component of the vector.  More... | |
| float | y = 0.0 | 
| The y component of the vector.  More... | |
| float | z = 0.0 | 
| The z component of the vector.  More... | |
Related Functions | |
(Note that these are not member functions.)  | |
| Print & | operator<< (Print &os, Vec3f v) | 
| Printing.  More... | |
| Vec3f | operator* (float lhs, Vec3f rhs) | 
| Scalar multiplication.  More... | |
| Print & | operator<< (Print &os, Vec3f v) | 
| Printing.  More... | |
Type for 3D vectors of floating point numbers.
Vec3fs can be added, subtracted, multiplied (dot product) and normalized. It also has an implementation of the following operators: "+", "+=", "-", "-=", "*" (vector-vector); "*", "*=", "/", "/=" (vector-scalar); "==", "!=" (equality); "*" (scalar-vector); "<<" (printing).
Definition at line 144 of file Vector.hpp.
      
  | 
  default | 
Create a vector that is initialized to the zero vector (0,0,0).
      
  | 
  inline | 
Create a vector with the given x, y and z coordinates.
Definition at line 152 of file Vector.hpp.
Definition at line 154 of file Vector.hpp.
      
  | 
  inline | 
Definition at line 155 of file Vector.hpp.
Addition.
Definition at line 162 of file Vector.hpp.
Addition.
Definition at line 169 of file Vector.hpp.
      
  | 
  inline | 
Negation.
Definition at line 176 of file Vector.hpp.
Subtraction.
Definition at line 178 of file Vector.hpp.
Subtraction.
Definition at line 180 of file Vector.hpp.
      
  | 
  inline | 
Scalar multiplication.
Definition at line 187 of file Vector.hpp.
      
  | 
  inline | 
Scalar multiplication.
Definition at line 194 of file Vector.hpp.
      
  | 
  inline | 
Scalar division.
Definition at line 201 of file Vector.hpp.
      
  | 
  inline | 
Scalar division.
Definition at line 208 of file Vector.hpp.
      
  | 
  inline | 
Inner product.
Definition at line 215 of file Vector.hpp.
      
  | 
  inline | 
Norm squared.
Definition at line 220 of file Vector.hpp.
      
  | 
  inline | 
Norm.
Definition at line 223 of file Vector.hpp.
      
  | 
  inline | 
Normalize this vector.
Definition at line 229 of file Vector.hpp.
      
  | 
  inline | 
Normalize a copy of this vector (doesn't change the original vector).
Definition at line 231 of file Vector.hpp.
      
  | 
  inline | 
Equality check.
Definition at line 234 of file Vector.hpp.
      
  | 
  inline | 
Inequality check.
Definition at line 238 of file Vector.hpp.
      
  | 
  related | 
Printing.
Definition at line 38 of file Vector.cpp.
| float x = 0.0 | 
The x component of the vector.
Definition at line 145 of file Vector.hpp.
| float y = 0.0 | 
The y component of the vector.
Definition at line 146 of file Vector.hpp.
| float z = 0.0 | 
The z component of the vector.
Definition at line 147 of file Vector.hpp.