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. | |
| bool | triangleIntersect (const Vector3f &v1, const Vector3f &v2, const Vector3f &v3, Vector3f *intersectionPoint=nullptr, Vector3f *intersectionPointNormal=nullptr) const |
| Returns true if the ray intersects the triangle. | |
| bool | quadIntersect (const Vector3f &v1, const Vector3f &v2, const Vector3f &v3, const Vector3f &v4, Vector3f *intersectionPoint=nullptr) const |
| Returns true if the ray intersects the quad. | |
| bool | lineIntersect (const Vector3f &v1, const Vector3f &v2, float radius, Vector3f *intersectionPoint=nullptr) const |
| Returns true if the ray intersects the line. | |
| bool | pointIntersect (const Vector3f &v1, float radius) const |
| Returns true if the ray intersects the point. | |
| bool | boxIntersect (const BoundingBox &box, Vector3f *intersectionPoint=nullptr) const |
| Returns true if the ray intersects the bounding box. | |
| bool | planeIntersect (const Plane &plane, Vector3f *intersectionPoint=nullptr) const |
| Returns true if the ray intersects the plane. | |
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.
| bool cil::Ray::boxIntersect | ( | const BoundingBox & | box, |
| Vector3f * | intersectionPoint = nullptr ) const |
Returns true if the ray intersects the bounding box.
| Vector3f cil::Ray::direction | ( | ) | const |
| bool cil::Ray::lineIntersect | ( | const Vector3f & | v1, |
| const Vector3f & | v2, | ||
| float | radius, | ||
| Vector3f * | intersectionPoint = nullptr ) const |
Returns true if the ray intersects the line.
| 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.
Returns true if the ray intersects the plane.
| bool cil::Ray::pointIntersect | ( | const Vector3f & | v1, |
| float | radius ) const |
Returns true if the ray intersects the point.
Gets the projected point of the other point on the current Ray.
| bool cil::Ray::quadIntersect | ( | const Vector3f & | v1, |
| const Vector3f & | v2, | ||
| const Vector3f & | v3, | ||
| const Vector3f & | v4, | ||
| Vector3f * | intersectionPoint = nullptr ) const |
Returns true if the ray intersects the quad.
Sets the origin point and direction of the Ray object.
| void cil::Ray::transform | ( | const Matrix4f & | other | ) |
Transform the current Ray object using the other transformation matrix.