C++ / OpenCL Raytracer
|
#include <vector.h>
Public Member Functions | |
Vector3D () | |
Vector3D (double e0) | |
Vector3D (double e0, double e1, double e2) | |
double | x () const |
Returns first (X) location parameter in Vector3D. | |
double | y () const |
Returns second (Y) location parameter in Vector3D. | |
double | z () const |
Returns third (Z) location parameter in Vector3D. | |
double | r () const |
Returns first (R) color parameter in Vector3D. | |
double | g () const |
Returns second (G) color parameter in Vector3D. | |
double | b () const |
Returns third (B) color parameter in Vector3D. | |
const Vector3D & | operator+ () const |
Add Vector3D Operator. | |
Vector3D | operator- () const |
Subtract Vector3D Operator. | |
double | operator[] (int i) const |
Constant Vector3D Array Operator. | |
double & | operator[] (int i) |
Vector3D Array Operator. | |
Vector3D & | operator+= (const Vector3D &v2) |
Add Assign Vector3D Operator. | |
Vector3D & | operator-= (const Vector3D &v2) |
Subtract Assign Assign Operator. | |
Vector3D & | operator *= (const Vector3D &v2) |
Multiply Assign Vector3D Operator. | |
Vector3D & | operator/= (const Vector3D &v2) |
Divide Assign Vector3D Operator. | |
Vector3D & | operator *= (const double t) |
Multiply Double Operator. | |
Vector3D & | operator/= (const double t) |
Divide Double Operator. | |
double | Length () const |
Return length (double) of Vector3D. | |
double | SquaredLength () const |
Return squared length (double) of Vector3D. | |
double | Dot (const Vector3D &v2) |
Return dot product (double) of two Vector3D. | |
Vector3D | Cross (const Vector3D &v2) |
void | MakeUnitVector () |
Convert Vector3D into unit vector. | |
Public Attributes | |
double | m_dE [3] |
Value array (double) for color or location parameters. | |
3 Paramater Vector3D object, operators and functions
object can be initialized with 0, 1, or 3 values.
|
inline |
Three value object for location or color
Example:
Vector3D zero;
|
inline |
Three value object for location or color
Example:
Vector3D one(1) // Vector3D one(1, 1, 1);
|
inline |
Three value object for location or color
Example:
Vector3D three(1, 2, 3);