#include <Ray.h>
Public Member Functions | |
Ray () | |
Ray (const Vector3 &origin, const Vector3 &direction) | |
Ray (float originX, float originY, float originZ, float dirX, float dirY, float dirZ) | |
Ray (const Ray ©) | |
~Ray () | |
const Vector3 & | getOrigin () const |
void | setOrigin (const Vector3 &origin) |
void | setOrigin (float x, float y, float z) |
const Vector3 & | getDirection () const |
void | setDirection (const Vector3 &direction) |
void | setDirection (float x, float y, float z) |
float | intersects (const BoundingSphere &sphere) const |
float | intersects (const BoundingBox &box) const |
float | intersects (const Frustum &frustum) const |
float | intersects (const Plane &plane) const |
void | set (const Vector3 &origin, const Vector3 &direction) |
void | set (const Ray &ray) |
void | transform (const Matrix &matrix) |
Ray & | operator*= (const Matrix &matrix) |
Static Public Attributes | |
static const int | INTERSECTS_NONE = -1 |
Defines a 3-dimensional ray.
Rays direction vector are always normalized.
Constructs a new ray initialized to origin(0,0,0) and direction(0,0,1).
gameplay::Ray::Ray | ( | const Vector3 & | origin, |
const Vector3 & | direction | ||
) |
Constructs a new ray initialized to the specified values.
origin | The ray's origin. |
direction | The ray's direction. |
gameplay::Ray::Ray | ( | float | originX, |
float | originY, | ||
float | originZ, | ||
float | dirX, | ||
float | dirY, | ||
float | dirZ | ||
) |
Constructs a new ray initialized to the specified values.
originX | The x coordinate of the origin. |
originY | The y coordinate of the origin. |
originZ | The z coordinate of the origin. |
dirX | The x coordinate of the direction. |
dirY | The y coordinate of the direction. |
dirZ | The z coordinate of the direction. |
gameplay::Ray::Ray | ( | const Ray & | copy | ) |
Constructs a new ray from the given ray.
copy | The ray to copy. |
Destructor.
const Vector3& gameplay::Ray::getDirection | ( | ) | const |
Gets the ray's direction.
const Vector3& gameplay::Ray::getOrigin | ( | ) | const |
Gets the ray's origin.
float gameplay::Ray::intersects | ( | const BoundingSphere & | sphere | ) | const |
Tests whether this ray intersects the specified bounding sphere.
sphere | The bounding sphere to test intersection with. |
float gameplay::Ray::intersects | ( | const BoundingBox & | box | ) | const |
Tests whether this ray intersects the specified bounding box.
box | The bounding box to test intersection with. |
float gameplay::Ray::intersects | ( | const Frustum & | frustum | ) | const |
Tests whether this ray intersects the specified frustum.
frustum | The frustum to test intersection with. |
float gameplay::Ray::intersects | ( | const Plane & | plane | ) | const |
Tests whether this ray intersects the specified plane and returns the distance from the origin of the ray to the plane.
plane | The plane to test intersection with. |
Transforms this ray by the given matrix.
matrix | The matrix to transform by. |
void gameplay::Ray::set | ( | const Vector3 & | origin, |
const Vector3 & | direction | ||
) |
Sets this ray to the specified values.
origin | The ray's origin. |
direction | The ray's direction. |
void gameplay::Ray::set | ( | const Ray & | ray | ) |
Sets this ray to the given ray.
ray | The ray to copy. |
void gameplay::Ray::setDirection | ( | const Vector3 & | direction | ) |
Sets the ray's direction to the given vector.
direction | The new direction vector. |
void gameplay::Ray::setDirection | ( | float | x, |
float | y, | ||
float | z | ||
) |
Sets the ray's direction.
x | The x coordinate of the direction. |
y | The y coordinate of the direction. |
z | The z coordinate of the direction. |
void gameplay::Ray::setOrigin | ( | const Vector3 & | origin | ) |
Sets the ray's origin to the given point.
origin | The new origin. |
void gameplay::Ray::setOrigin | ( | float | x, |
float | y, | ||
float | z | ||
) |
Sets the ray's origin.
x | The x coordinate of the origin. |
y | The y coordinate of the origin. |
z | The z coordinate of the origin. |
void gameplay::Ray::transform | ( | const Matrix & | matrix | ) |
Transforms this ray by the given transformation matrix.
matrix | The transformation matrix to transform by. |
const int gameplay::Ray::INTERSECTS_NONE = -1 [static] |
Represents when a 3D entity does not intersect a ray.