The Ray class inherits from the Tuple class, specilizing the templated parameter to float for element type. More...
#include <ray.h>
Public Member Functions | |
| Ray () | |
| Constructs a Ray object, all elements initialized to 0. | |
| Ray (const Ray &other) | |
| Ray (const Vector3f &origin, const Vector3f &normal) | |
| Constructs a Ray object using the origin point and the direction. | |
| const float & | operator[] (int index) const |
| Provides read-only access to the element at a specific index(position) within the Ray object. | |
| float & | operator[] (int index) |
| Provides read-write access to the element at a specific index(position) within the Ray object. | |
| void | set (const Vector3f &origin, const Vector3f &direction) |
| Sets the origin point and direction of the Ray object. | |
| Vector3f | origin () const |
| Gets a Vector3f object that is the origin of the current Ray. | |
| void | setOrigin (const Vector3f &origin) |
| Sets the origin of the current Ray. | |
| Vector3f | direction () const |
| Gets a Vector3f object that is the direction of the current Ray. | |
| void | setDirection (const Vector3f &direction) |
| Sets the direction ot the current Ray. | |
| Vector3f | project (const Vector3f &point) const |
| Gets the projected point of the other point on the current Ray. | |
| void | transform (const Matrix4f &other) |
| Transform the current Ray object using the other transformation matrix. | |
Public Member Functions inherited from cil::Tuple< float > | |
| Tuple (int size) | |
| Constructs a Tuple object with a specified number of elements, and initialize all elements to 0. | |
| virtual | ~Tuple () |
| int | size () const |
| Gets the number of elements of the Tuple. | |
| float * | data () |
| Gets the data array of the Tuple. | |
| const float * | data () const |
| Gets the data array of the Tuple, and the data could not be modified upon which this function is called. | |
| void | setData (const float *data) |
| Sets the data array of the Variant. | |
| Tuple< float > & | operator= (const Tuple &other) |
| Copys the data of another Tuple to the one on which the operator is invoked. | |
| bool | operator== (const Tuple &other) const |
| Compares the Tuple with another one, and returns true if they are equal, otherwise returns false. | |
| bool | operator!= (const Tuple &other) const |
| Compares the Tuple with another one, and returns false if they are equal, otherwise returns true. | |
Public Member Functions inherited from cil::Variant | |
| Variant () | |
| virtual | ~Variant () |
| const std::string & | type () const |
Additional Inherited Members | |
Protected Attributes inherited from cil::Tuple< float > | |
| float * | m_data |
| The data array of the Tuple. | |
| int | m_size |
| The number of elements that the data array of the Tuple holds. | |
Protected Attributes inherited from cil::Variant | |
| std::string | m_type |
The Ray class inherits from the Tuple class, specilizing the templated parameter to float for element type.
The Ray object is represented in 3D space using a origin point(the first three elements) and a direction(the last three elements), so it stores six elements.
| cil::Ray::Ray | ( | ) |
Constructs a Ray object, all elements initialized to 0.
| cil::Ray::Ray | ( | const Ray & | other | ) |
Constructs a Ray object using the origin point and the direction.
| Vector3f cil::Ray::direction | ( | ) | const |
| float & cil::Ray::operator[] | ( | int | index | ) |
Provides read-write access to the element at a specific index(position) within the Ray object.
| const float & cil::Ray::operator[] | ( | int | index | ) | const |
Provides read-only access to the element at a specific index(position) within the Ray object.
Gets the projected point of the other point on the current Ray.
Sets the origin point and direction of the Ray object.