Ray can be mathematically defined as a point (the origin of the ray in space) and a direction. More...
#include <kanzi/core/math/ray.hpp>
Public Member Functions | |
Vector3 | getDirection () const |
Gets the direction of a ray. More... | |
Vector3 | getOrigin () const |
Gets the origin of a ray. More... | |
Ray () | |
Default constructor. More... | |
Ray (const Vector3 origin, const Vector3 direction) | |
Constructor. More... | |
Ray | transform (const Matrix4x4 &matrix) const |
Returns a transformed ray, using a 4x4 matrix. More... | |
Ray can be mathematically defined as a point (the origin of the ray in space) and a direction.
Kanzi uses rays for resolving the input to find where in 3D space the user clicked.
|
inlineexplicit |
Default constructor.
Initializes the ray components to identity, origin=(0,0,0) and direction=(0,0,0).
Constructor.
Constructs a ray from point and a direction vector. Normalizes the direction vector.
origin | The origin of the ray in 3D space. |
direction | The direction of the ray. The method normalizes the value before storing the value. |
|
inline |
Gets the origin of a ray.
|
inline |
Gets the direction of a ray.
Returns a transformed ray, using a 4x4 matrix.
matrix | Transform matrix. |