OGRE-Next  3.0.0unstable
Object-Oriented Graphics Rendering Engine
Ogre::Ray Class Reference

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

#include <OgreRay.h>

Public Member Functions

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

Detailed Description

Representation of a ray in space, i.e.

a line with an origin and direction.

Constructor & Destructor Documentation

◆ Ray() [1/2]

Ogre::Ray::Ray ( )
inline

◆ Ray() [2/2]

Ogre::Ray::Ray ( const Vector3 origin,
const Vector3 direction 
)
inline

Member Function Documentation

◆ getDirection()

const Vector3& Ogre::Ray::getDirection ( ) const
inline

Gets the direction of the ray.

◆ getOrigin()

const Vector3& Ogre::Ray::getOrigin ( ) const
inline

Gets the origin of the ray.

◆ getPoint()

Vector3 Ogre::Ray::getPoint ( Real  t) const
inline

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

◆ intersects() [1/4]

std::pair<bool, Real> Ogre::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().

References Ogre::Math::intersects().

◆ intersects() [2/4]

std::pair<bool, Real> Ogre::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().

References Ogre::Math::intersects().

◆ intersects() [3/4]

std::pair<bool, Real> Ogre::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().

References Ogre::Math::intersects(), Ogre::PlaneBoundedVolume::outside, Ogre::PlaneBoundedVolume::planes, and Ogre::Plane::POSITIVE_SIDE.

◆ intersects() [4/4]

std::pair<bool, Real> Ogre::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().

References Ogre::Math::intersects().

◆ operator*()

Vector3 Ogre::Ray::operator* ( Real  t) const
inline

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

◆ setDirection()

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

Sets the direction of the ray.

◆ setOrigin()

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

Sets the origin of the ray.


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