Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# Ogre::Ray Class Reference

Representation of a ray in space, ie a line with an origin and direction. More...

`#include <OgreRay.h>`

List of all members.

## Public Methods

| Ray ()
| Ray (const Vector3 &origin, const Vector3 &direction)
virtual | ~Ray ()
void | setOrigin (const Vector3 &origin)
| Sets the origin of the ray.
const Vector3 & | getOrigin (void) const
| Gets the origin of the ray.
void | setDirection (const Vector3 &dir)
| Sets the direction of the ray.
const Vector3 & | getDirection (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, Real > | intersects (const Plane &p) const
| Tests whether this ray intersects the given plane.
std::pair< bool, Real > | intersects (const Sphere &s) const
| Tests whether this ray intersects the given sphere.
std::pair< bool, Real > | intersects (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, ie a line with an origin and direction.

Definition at line 36 of file OgreRay.h.

## Constructor & Destructor Documentation

Ogre::Ray::Ray | ( |  | ) |

| Definition at line 42 of file OgreRay.h.

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

| Definition at line 43 of file OgreRay.h.

virtual Ogre::Ray::~Ray | ( |  | ) | `[virtual]`

| Definition at line 45 of file OgreRay.h.

## Member Function Documentation

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

| Gets the direction of the ray. Definition at line 55 of file OgreRay.h. Referenced by Ogre::TerrainRaySceneQuery::execute(), Ogre::intersect(), and Ogre::Math::intersects().

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

| Gets the origin of the ray. Definition at line 50 of file OgreRay.h. Referenced by Ogre::TerrainRaySceneQuery::execute(), Ogre::intersect(), and Ogre::Math::intersects().

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

| Gets the position of a point t units along the ray. Definition at line 58 of file OgreRay.h. References Ogre::Real.

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 93 of file OgreRay.h.

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 83 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 73 of file OgreRay.h.

Referenced by Ogre::DefaultRaySceneQuery::execute(), and Ogre::OctreeRaySceneQuery::execute().

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

| Gets the position of a point t units along the ray. Definition at line 63 of file OgreRay.h. References Ogre::Real.

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

| Sets the direction of the ray. Definition at line 53 of file OgreRay.h.

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

| Sets the origin of the ray. Definition at line 48 of file OgreRay.h.

## Member Data Documentation

Vector3 Ogre::Ray::mDirection`[protected]`

| Definition at line 40 of file OgreRay.h.

Vector3 Ogre::Ray::mOrigin`[protected]`

| Definition at line 39 of file OgreRay.h.

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

- OgreRay.h

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:51:27 2004