Ogre::Ray Class Reference

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

#include <OgreRay.h>

List of all members.

Public Member Functions

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

Protected Attributes

Vector3 mOrigin
Vector3 mDirection


Detailed Description

Representation of a ray in space, i.e.

a line with an origin and direction.

Definition at line 41 of file OgreRay.h.


Constructor & Destructor Documentation

Ogre::Ray::Ray (  ) 

Definition at line 47 of file OgreRay.h.

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

Definition at line 48 of file OgreRay.h.


Member Function Documentation

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

Sets the origin of the ray.

Definition at line 52 of file OgreRay.h.

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

Gets the origin of the ray.

Definition at line 54 of file OgreRay.h.

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

Sets the direction of the ray.

Definition at line 57 of file OgreRay.h.

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

Gets the direction of the ray.

Definition at line 59 of file OgreRay.h.

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

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

Definition at line 62 of file OgreRay.h.

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

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

Definition at line 67 of file OgreRay.h.

std::pair<bool, Real> Ogre::Ray::intersects ( const Plane p  )  const

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().

Definition at line 77 of file OgreRay.h.

References Ogre::Math::intersects().

std::pair<bool, Real> Ogre::Ray::intersects ( const PlaneBoundedVolume p  )  const

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().

Definition at line 87 of file OgreRay.h.

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

std::pair<bool, Real> Ogre::Ray::intersects ( const Sphere s  )  const

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().

Definition at line 97 of file OgreRay.h.

References Ogre::Math::intersects().

std::pair<bool, Real> Ogre::Ray::intersects ( const AxisAlignedBox box  )  const

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().

Definition at line 107 of file OgreRay.h.

References Ogre::Math::intersects().


Member Data Documentation

Definition at line 44 of file OgreRay.h.

Definition at line 45 of file OgreRay.h.


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

Copyright © 2008 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Sep 27 22:05:19 2009