My Project
Public Member Functions | Protected Attributes | List of all members
ParaEngine::Ray Class Reference

Representation of a ray in space, i.e. More...

#include <ParaRay.h>

Public Member Functions

 Ray (const Vector3 &origin, const Vector3 &direction)
 
void setOrigin (const Vector3 &origin)
 Sets the origin of the ray. More...
 
const Vector3getOrigin (void) const
 Gets the origin of the ray. More...
 
void setDirection (const Vector3 &dir)
 Sets the direction of the ray. More...
 
const Vector3getDirection (void) const
 Gets the direction of the ray. More...
 
Vector3 getPoint (float t) const
 Gets the position of a point t units along the ray. More...
 
Vector3 operator* (float t) const
 Gets the position of a point t units along the ray. More...
 
std::pair< bool, float > intersects (const Plane &p) const
 Tests whether this ray intersects the given plane. More...
 
std::pair< bool, float > intersects (const PlaneBoundedVolume &p) const
 Tests whether this ray intersects the given plane bounded volume. More...
 
std::pair< bool, float > intersects (const Sphere &s) const
 Tests whether this ray intersects the given sphere. More...
 
std::pair< bool, float > intersects (const AxisAlignedBox &box) const
 Tests whether this ray intersects the given box. More...
 

Protected Attributes

Vector3 mOrigin
 
Vector3 mDirection
 

Detailed Description

Representation of a ray in space, i.e.

a line with an origin and direction.

Member Function Documentation

§ getDirection()

const Vector3& ParaEngine::Ray::getDirection ( void  ) const
inline

Gets the direction of the ray.

§ getOrigin()

const Vector3& ParaEngine::Ray::getOrigin ( void  ) const
inline

Gets the origin of the ray.

§ getPoint()

Vector3 ParaEngine::Ray::getPoint ( float  t) const
inline

Gets the position of a point t units along the ray.

§ intersects() [1/4]

std::pair<bool, float> ParaEngine::Ray::intersects ( const Plane p) const
inline

Tests whether this ray intersects the given plane.

Returns
A pair structure where the first element indicates whether an intersection occurs, and if true, the second element will indicate the distance along the ray at which it intersects. This can be converted to a point in space by calling getPoint().

§ intersects() [2/4]

std::pair<bool, float> ParaEngine::Ray::intersects ( const PlaneBoundedVolume p) const
inline

Tests whether this ray intersects the given plane bounded volume.

Returns
A pair structure where the first element indicates whether an intersection occurs, and if true, the second element will indicate the distance along the ray at which it intersects. This can be converted to a point in space by calling getPoint().

§ intersects() [3/4]

std::pair<bool, float> ParaEngine::Ray::intersects ( const Sphere s) const
inline

Tests whether this ray intersects the given sphere.

Returns
A pair structure where the first element indicates whether an intersection occurs, and if true, the second element will indicate the distance along the ray at which it intersects. This can be converted to a point in space by calling getPoint().

§ intersects() [4/4]

std::pair<bool, float> ParaEngine::Ray::intersects ( const AxisAlignedBox box) const
inline

Tests whether this ray intersects the given box.

Returns
A pair structure where the first element indicates whether an intersection occurs, and if true, the second element will indicate the distance along the ray at which it intersects. This can be converted to a point in space by calling getPoint().

§ operator*()

Vector3 ParaEngine::Ray::operator* ( float  t) const
inline

Gets the position of a point t units along the ray.

§ setDirection()

void ParaEngine::Ray::setDirection ( const Vector3 dir)
inline

Sets the direction of the ray.

§ setOrigin()

void ParaEngine::Ray::setOrigin ( const Vector3 origin)
inline

Sets the origin of the ray.


The documentation for this class was generated from the following file: