The Plane class inherits from the Tuple class, specilizing the templated parameter to float for element type. More...
#include <plane.h>
Public Member Functions | |
| Plane () | |
| Constructs a Plane object, all coefficients initialized to 0. | |
| Plane (const Plane &other) | |
| Plane (float a, float b, float c, float d) | |
| Constructs a Plane object and sets its coefficients with arguments (x, y, z, w). | |
| Plane (const Vector3f &origin, const Vector3f &normal) | |
| Constructs a Plane objet using the point-normal equation A(x-x0) + B(y-y0) +C(z-z0) = 0, so the a = A, b = B, c = C, d = - (Ax0 + By0 + Cz0). | |
| const float & | operator[] (int index) const |
| Provides read-only access to the element at a specific index(position) within the Plane object. | |
| float & | operator[] (int index) |
| Provides read-write access to the element at a specific index(position) within the Plane object. | |
| const float & | operator[] (char key) const |
| Provides read-only access to a element within the Plane object using a character key. | |
| float & | operator[] (char key) |
| Provides read-write access to a element within the Plane object using a character key. | |
| void | set (float a, float b, float c, float d) |
| Sets the coefficients of the Plane. | |
| void | set (const Vector3f &origin, const Vector3f &normal) |
| Sets the coefficients of the Plane using the point-normal equation A(x-x0) + B(y-y0) +C(z-z0) = 0 of the Plane object. | |
| Vector3f | normal () const |
| Gets the normal of the Plane. | |
| Vector3f | origin () const |
| Gets the origin of the Plane. | |
| void | flip () |
| Flips the Plane normal direction by negating all coefficients. | |
| Vector3f | project (const Vector3f &point) const |
| Calculates and returns the projected point of the argument point on the current Plane object. | |
| void | transform (const Matrix4f &other) |
| Transform the current Plane 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 Plane class inherits from the Tuple class, specilizing the templated parameter to float for element type.
The Plane object is represented in 3D space using the equation(ax + by + cz + d = 0), and stores the coefficients (a, b, c, d).
| cil::Plane::Plane | ( | ) |
Constructs a Plane object, all coefficients initialized to 0.
| cil::Plane::Plane | ( | const Plane & | other | ) |
| cil::Plane::Plane | ( | float | a, |
| float | b, | ||
| float | c, | ||
| float | d ) |
Constructs a Plane object and sets its coefficients with arguments (x, y, z, w).
Constructs a Plane objet using the point-normal equation A(x-x0) + B(y-y0) +C(z-z0) = 0, so the a = A, b = B, c = C, d = - (Ax0 + By0 + Cz0).
| void cil::Plane::flip | ( | ) |
Flips the Plane normal direction by negating all coefficients.
| float & cil::Plane::operator[] | ( | char | key | ) |
| const float & cil::Plane::operator[] | ( | char | key | ) | const |
| float & cil::Plane::operator[] | ( | int | index | ) |
Provides read-write access to the element at a specific index(position) within the Plane object.
| const float & cil::Plane::operator[] | ( | int | index | ) | const |
Provides read-only access to the element at a specific index(position) within the Plane object.
Calculates and returns the projected point of the argument point on the current Plane object.
| void cil::Plane::set | ( | float | a, |
| float | b, | ||
| float | c, | ||
| float | d ) |
Sets the coefficients of the Plane.