|
Path Tracer
|
A three-dimensional vector using double values. More...
#include <DoubleVec3D.h>
Public Member Functions | |
| DoubleVec3D (double val=0) | |
| Default constructor. Gives all coordinates the same value. More... | |
| DoubleVec3D (double x, double y, double z) | |
| Main constructor. More... | |
| DoubleVec3D (const DoubleVec3D &vec) | |
| Copy constructor. More... | |
| DoubleVec3D (const FbxDouble3 &vec) | |
| Converting constructor for FbxDouble3. More... | |
| DoubleVec3D (const FbxDouble4 &vec) | |
| Converting constructor for FbxDouble4. More... | |
| double | getX () const |
| Getter for the first coordinate. More... | |
| double | getY () const |
| Getter for the second coordinate. More... | |
| double | getZ () const |
| Getter for the third coordinate. More... | |
| virtual void | setVals (double x, double y, double z) |
| Setter for all coordinates. More... | |
| void | operator+= (const DoubleVec3D &vec) |
| Sum operator. More... | |
| void | operator-= (const DoubleVec3D &vec) |
| Difference operator. More... | |
| void | operator*= (const double &val) |
| Multiplication by a scalar operator. More... | |
| void | operator/= (const double &val) |
| Division by a scalar operator. More... | |
| void | normalise () |
| Normalises the vector. More... | |
| bool | isNormalised () const |
| Returns whether the vector is normalised. More... | |
| bool | isZero () const |
| Returns whether the vector has a length of zero. More... | |
Protected Attributes | |
| bool | normalised |
| Stores whether the vector was normalised. More... | |
A three-dimensional vector using double values.
| DoubleVec3D::DoubleVec3D | ( | double | val = 0 | ) |
Default constructor. Gives all coordinates the same value.
| val | The value of all the coordinates. |
| DoubleVec3D::DoubleVec3D | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
Main constructor.
| x | The value of the first coordinate. |
| y | The value of the second coordinate. |
| z | The value of the third coordinate. |
| DoubleVec3D::DoubleVec3D | ( | const DoubleVec3D & | vec | ) |
Copy constructor.
| vec | The vector that will be copied. |
| DoubleVec3D::DoubleVec3D | ( | const FbxDouble3 & | vec | ) |
Converting constructor for FbxDouble3.
| vec | The FbxDouble3 vector (from the FBX SDK library) that will be converted. |
| DoubleVec3D::DoubleVec3D | ( | const FbxDouble4 & | vec | ) |
Converting constructor for FbxDouble4.
| vec | The FbxDouble4 vector (from the FBX SDK library) that will be converted. |
| double DoubleVec3D::getX | ( | ) | const |
Getter for the first coordinate.
| double DoubleVec3D::getY | ( | ) | const |
Getter for the second coordinate.
| double DoubleVec3D::getZ | ( | ) | const |
Getter for the third coordinate.
| bool DoubleVec3D::isNormalised | ( | ) | const |
Returns whether the vector is normalised.
| bool DoubleVec3D::isZero | ( | ) | const |
Returns whether the vector has a length of zero.
| void DoubleVec3D::normalise | ( | ) |
Normalises the vector.
Automatically verifies if normalised attribute is true or not. If the vector length is zero, sets it to (1, 0, 0).
| void DoubleVec3D::operator*= | ( | const double & | val | ) |
Multiplication by a scalar operator.
| val | The scalar that will be used for the multiplication. |
| void DoubleVec3D::operator+= | ( | const DoubleVec3D & | vec | ) |
Sum operator.
| vec | The second vector that will be used for the sum. |
| void DoubleVec3D::operator-= | ( | const DoubleVec3D & | vec | ) |
Difference operator.
Uses the sum and unary minus operators.
| vec | The second vector that will be used for the difference. |
| void DoubleVec3D::operator/= | ( | const double & | val | ) |
Division by a scalar operator.
Uses the multiplication by a scalar operator.
| val | The scalar that will be used for the division. |
|
virtual |
Setter for all coordinates.
There is not one setter by coordinate, because of the way the DoubleUnitVect3D class is defined.
| x | The first coordinate. |
| y | The second coordinate. |
| z | The third coordinate. |
Reimplemented in DoubleUnitVec3D.
|
protected |
Stores whether the vector was normalised.
This value is set to false when we change any value of the vector (even if it gives it a magnitude of 1), and is set to true when the DoubleVec3D::normalise() method is called.