Castor3D 0.16.0
Multiplatform 3D engine
|
#include <Ray.hpp>
Public Member Functions | |
C3D_API | Ray (castor::Position const &point, Camera const &camera) |
Constructor from mouse coordinates and a camera. | |
C3D_API | Ray (int x, int y, Camera const &camera) |
Constructor from mouse coordinates and a camera. | |
C3D_API | Ray (castor::Point3f const &origin, castor::Point3f const &direction) |
Constructor from origin and direction. | |
C3D_API castor::Intersection | intersects (castor::Point3f const &pt1, castor::Point3f const &pt2, castor::Point3f const &pt3, float &distance) const |
Tells if the ray intersects the given triangle of vertices. | |
C3D_API castor::Intersection | intersects (Face const &face, castor::Matrix4x4f const &transform, Submesh const &submesh, float &distance) const |
Tells if the ray intersects the given face. | |
C3D_API castor::Intersection | intersects (castor::Point3f const &point, float &distance) const |
Tells if the vertex is on the ray. | |
C3D_API castor::Intersection | intersects (castor::BoundingBox const &box, float &distance) const |
Tells if the ray intersects the given Combo box. | |
C3D_API castor::Intersection | intersects (castor::BoundingSphere const &sphere, float &distance) const |
Tells if the ray intersects the given Sphere. | |
C3D_API castor::Intersection | intersects (GeometryRPtr geometry, Face &nearestFace, SubmeshRPtr &nearestSubmesh, float &distance) const |
Tells if the ray intersects the given Geometry. | |
C3D_API bool | projectVertex (castor::Point3f const &point, castor::Point3f &result) const |
Projects the given vertex on the ray. | |
Public Attributes | |
castor::Point3f | m_origin |
castor::Point3f | m_direction |
C3D_API castor3d::Ray::Ray | ( | castor::Position const & | point, |
Camera const & | camera ) |
Constructor from mouse coordinates and a camera.
[in] | point | The mouse coordinates. |
[in] | camera | The camera from which to retrieve the ray. |
Constructor from mouse coordinates and a camera.
[in] | x,y | The mouse coordinates. |
[in] | camera | The camera from which to retrieve the ray. |
C3D_API castor3d::Ray::Ray | ( | castor::Point3f const & | origin, |
castor::Point3f const & | direction ) |
Constructor from origin and direction.
[in] | origin | The origin of the ray. |
[in] | direction | The direction of the ray. |
C3D_API castor::Intersection castor3d::Ray::intersects | ( | castor::BoundingBox const & | box, |
float & | distance ) const |
Tells if the ray intersects the given Combo box.
[in] | box | The box to test. |
[out] | distance | Receives the distance. |
C3D_API castor::Intersection castor3d::Ray::intersects | ( | castor::BoundingSphere const & | sphere, |
float & | distance ) const |
Tells if the ray intersects the given Sphere.
[in] | sphere | The sphere to test. |
[out] | distance | Receives the distance. |
C3D_API castor::Intersection castor3d::Ray::intersects | ( | castor::Point3f const & | point, |
float & | distance ) const |
Tells if the vertex is on the ray.
[in] | point | The vertex to test. |
[out] | distance | Receives the distance. |
C3D_API castor::Intersection castor3d::Ray::intersects | ( | castor::Point3f const & | pt1, |
castor::Point3f const & | pt2, | ||
castor::Point3f const & | pt3, | ||
float & | distance ) const |
Tells if the ray intersects the given triangle of vertices.
[in] | pt1 | The first triangle vertex. |
[in] | pt2 | The second triangle vertex. |
[in] | pt3 | The third triangle vertex. |
[out] | distance | Receives the distance. |
C3D_API castor::Intersection castor3d::Ray::intersects | ( | Face const & | face, |
castor::Matrix4x4f const & | transform, | ||
Submesh const & | submesh, | ||
float & | distance ) const |
Tells if the ray intersects the given face.
[in] | face | The face to test. |
[in] | transform | The face's vertex transformation matrix. |
[in] | submesh | The submesh holding the face. |
[out] | distance | Receives the distance. |
C3D_API castor::Intersection castor3d::Ray::intersects | ( | GeometryRPtr | geometry, |
Face & | nearestFace, | ||
SubmeshRPtr & | nearestSubmesh, | ||
float & | distance ) const |
Tells if the ray intersects the given Geometry.
[in] | geometry | The geometry to test. |
[out] | nearestFace | Receives the intersected face. |
[out] | nearestSubmesh | Receives the intersected submesh. |
[out] | distance | Receives the distance. |
C3D_API bool castor3d::Ray::projectVertex | ( | castor::Point3f const & | point, |
castor::Point3f & | result ) const |
Projects the given vertex on the ray.
[in] | point | The vertex we want to project. |
[out] | result | The projecion result. |
true
if the vertex can be projected on the ray, false if not. castor::Point3f castor3d::Ray::m_direction |
The ray direction.
castor::Point3f castor3d::Ray::m_origin |
The ray origin.