Path Tracer
Public Member Functions | List of all members
DoubleUnitVec3D Class Reference

A three-dimensional unit vector using doubles. More...

#include <DoubleUnitVec3D.h>

Inheritance diagram for DoubleUnitVec3D:
[legend]
Collaboration diagram for DoubleUnitVec3D:
[legend]

Public Member Functions

 DoubleUnitVec3D ()
 Default constructor. More...
 
 DoubleUnitVec3D (double x, double y, double z, bool alreadyNormalised=false)
 Main constructor. More...
 
 DoubleUnitVec3D (const DoubleVec3D &vec, bool alreadyNormalised=false)
 Converting constructor for DoubleVec3D. More...
 
 DoubleUnitVec3D (const DoubleUnitVec3D &vec)
 Copy constructor. More...
 
virtual void setVals (double x, double y, double z)
 Setter for all coordinates. More...
 
void operator= (const DoubleVec3D &vec)
 Assignment operator. More...
 
- Public Member Functions inherited from DoubleVec3D
 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...
 
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...
 

Additional Inherited Members

- Protected Attributes inherited from DoubleVec3D
bool normalised
 Stores whether the vector was normalised. More...
 

Detailed Description

A three-dimensional unit vector using doubles.

Inherits of the class DoubleVec3D. Each time a value is changed, automatically calls the DoubleVec3D::normalise() method.

Constructor & Destructor Documentation

◆ DoubleUnitVec3D() [1/4]

DoubleUnitVec3D::DoubleUnitVec3D ( )

Default constructor.

Sets the vector to (1, 0, 0).

◆ DoubleUnitVec3D() [2/4]

DoubleUnitVec3D::DoubleUnitVec3D ( double  x,
double  y,
double  z,
bool  alreadyNormalised = false 
)

Main constructor.

Parameters
xThe first coordinate.
yThe second coordinate.
zThe third coordinate.
alreadyNormalisedIf true, skips the normalisation when instantiated.
See also
DoubleVec3D::normalise()

◆ DoubleUnitVec3D() [3/4]

DoubleUnitVec3D::DoubleUnitVec3D ( const DoubleVec3D vec,
bool  alreadyNormalised = false 
)

Converting constructor for DoubleVec3D.

Parameters
vecThe vector that will be converted.
alreadyNormalisedIf true, skips the normalisation when instantiated.
See also
DoubleVec3D::normalise()

◆ DoubleUnitVec3D() [4/4]

DoubleUnitVec3D::DoubleUnitVec3D ( const DoubleUnitVec3D vec)

Copy constructor.

Parameters
vecThe unit vector that will be copied.

Member Function Documentation

◆ operator=()

void DoubleUnitVec3D::operator= ( const DoubleVec3D vec)

Assignment operator.

Parameters
vecThe vector to which this will be equal.

◆ setVals()

void DoubleUnitVec3D::setVals ( double  x,
double  y,
double  z 
)
virtual

Setter for all coordinates.

Calls the normalisation method after this one.

Parameters
xThe first coordinate.
yThe second coordinate.
zThe third coordinate.
See also
normalise()

Reimplemented from DoubleVec3D.


The documentation for this class was generated from the following files: