EvEmu
0.8.4
11 September 2021
|
#include "Vector3D.h"
Public Member Functions | |
Vector3D () | |
Vector3D (double nx, double ny, double nz) | |
Vector3D (const Vector3D &v) | |
Vector3D | copy () const |
double | magnitude () const |
double | length () const |
double | lengthSquared () const |
void | normalize () |
double | dotProduct (const Vector3D &v) const |
Vector3D | crossProduct (const Vector3D &v) const |
Vector3D | reflection (Vector3D norm) const |
Vector3D | refraction (Vector3D norm, double fact) const |
void | set (double nx, double ny, double nz) |
void | set (const Vector3D &v) |
bool | operator== (const Vector3D &v) |
bool | operator!= (const Vector3D &v) |
Vector3D & | operator= (const Vector3D &v) |
Vector3D | operator+ (const Vector3D &v) const |
Vector3D & | operator+= (const Vector3D &v) |
Vector3D | operator- (const Vector3D &v) const |
Vector3D & | operator-= (const Vector3D &v) |
Vector3D | operator* (const Vector3D &v) const |
Vector3D & | operator*= (const Vector3D &v) |
Vector3D | operator/ (const Vector3D &v) const |
Vector3D & | operator/= (const Vector3D &v) |
Vector3D | operator* (const double &k) const |
Vector3D & | operator*= (const double &k) |
Vector3D | operator/ (const double &k) const |
Vector3D & | operator/= (const double &k) |
bool | isNotZero () |
void | MakeRandomPointOnSphere (double radius) |
void | MakeRandomPointOnSphereLayer (double radiusInner, double radiusOuter) |
Public Attributes | |
double | x |
double | y |
double | z |
A 3 dimensional double vector.
Definition at line 37 of file Vector3D.h.
|
inline |
Definition at line 42 of file Vector3D.h.
Referenced by copy(), crossProduct(), operator*(), operator+(), operator-(), and operator/().
|
inline |
Definition at line 47 of file Vector3D.h.
|
inline |
Definition at line 54 of file Vector3D.h.
|
inline |
Return a copy of the vector.
Definition at line 65 of file Vector3D.h.
References Vector3D().
Calculate the cross product of this vector and the provided vector.
v | The provided vector. |
Definition at line 64 of file Vector3D.cpp.
References Vector3D(), x, y, and z.
double Vector3D::dotProduct | ( | const Vector3D & | v | ) | const |
Calculate the dot product of this vector and the provided vector.
v | The provided vector. |
Definition at line 59 of file Vector3D.cpp.
Referenced by reflection(), and refraction().
|
inline |
Definition at line 163 of file Vector3D.h.
|
inline |
Definition at line 76 of file Vector3D.h.
References magnitude().
|
inline |
double Vector3D::magnitude | ( | ) | const |
Retrieves the length of the Vector.
Definition at line 28 of file Vector3D.cpp.
Referenced by length().
|
inline |
Definition at line 173 of file Vector3D.h.
References MakeRandomFloat().
|
inline |
Definition at line 187 of file Vector3D.h.
References MakeRandomFloat().
void Vector3D::normalize | ( | ) |
|
inline |
Definition at line 141 of file Vector3D.h.
Definition at line 143 of file Vector3D.cpp.
References Vector3D().
Vector3D Vector3D::operator* | ( | const double & | k | ) | const |
Definition at line 169 of file Vector3D.cpp.
References Vector3D().
Definition at line 148 of file Vector3D.cpp.
Vector3D & Vector3D::operator*= | ( | const double & | k | ) |
Definition at line 174 of file Vector3D.cpp.
Definition at line 117 of file Vector3D.cpp.
References Vector3D().
Definition at line 122 of file Vector3D.cpp.
Definition at line 130 of file Vector3D.cpp.
References Vector3D().
Definition at line 135 of file Vector3D.cpp.
Definition at line 156 of file Vector3D.cpp.
References Vector3D().
Vector3D Vector3D::operator/ | ( | const double & | k | ) | const |
Definition at line 182 of file Vector3D.cpp.
References Vector3D().
Definition at line 161 of file Vector3D.cpp.
Vector3D & Vector3D::operator/= | ( | const double & | k | ) |
Definition at line 187 of file Vector3D.cpp.
Definition at line 109 of file Vector3D.cpp.
|
inline |
Definition at line 137 of file Vector3D.h.
Calculate the reflection vector for a surface with the specified normal.
norm | The surface normal of the surface to reflect from. |
Definition at line 72 of file Vector3D.cpp.
References dotProduct().
Calculate the refraction vector for a surface with the specified normal.
norm | The surface normal of the surface to refract through. |
fact | The refraction factor. |
Definition at line 80 of file Vector3D.cpp.
References dotProduct().
void Vector3D::set | ( | double | nx, |
double | ny, | ||
double | nz | ||
) |
Set the values of the vector.
nx | The new value for X. |
ny | The new value for Y. |
nz | The new value for Z. |
Definition at line 95 of file Vector3D.cpp.
void Vector3D::set | ( | const Vector3D & | v | ) |
Set the values of the vector.
v | The new value for the vector. |
Definition at line 102 of file Vector3D.cpp.
double Vector3D::x |
Definition at line 40 of file Vector3D.h.
Referenced by crossProduct(), dotProduct(), magnitude(), normalize(), operator!=(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), operator==(), set(), and Vector3D().
double Vector3D::y |
Definition at line 40 of file Vector3D.h.
Referenced by crossProduct(), dotProduct(), lengthSquared(), magnitude(), normalize(), operator!=(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), operator==(), set(), and Vector3D().
double Vector3D::z |
Definition at line 40 of file Vector3D.h.
Referenced by crossProduct(), dotProduct(), magnitude(), normalize(), operator!=(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), operator==(), set(), and Vector3D().