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

# Ogre::Plane Class Reference

Defines a plane in 3D space. More...

`#include <OgrePlane.h>`

Inheritance diagram for Ogre::Plane:

[legend]
List of all members.

## Public Types

enum | Side { NO_SIDE, POSITIVE_SIDE, NEGATIVE_SIDE }
| The "positive side" of the plane is the half space to which the plane normal points. More...

## Public Methods

| Plane ()
| Default constructor - sets everything to 0.
| Plane (const Plane &rhs)
| Plane (const Vector3 &rkNormal, Real fConstant)
| Construct a plane through a normal, and a distance to move the plane along the normal.
| Plane (const Vector3 &rkNormal, const Vector3 &rkPoint)
| Plane (const Vector3 &rkPoint0, const Vector3 &rkPoint1, const Vector3 &rkPoint2)
Side | getSide (const Vector3 &rkPoint) const
Real | getDistance (const Vector3 &rkPoint) const
| This is a pseudodistance.
void | redefine (const Vector3 &rkPoint0, const Vector3 &rkPoint1, const Vector3 &rkPoint2)
| Redefine this plane based on 3 points.
bool | operator== (const Plane &rhs) const
| Comparison operator.

## Public Attributes

Vector3 | normal
Real | d

## Friends

_OgreExport friend std::ostream & | operator<< (std::ostream &o, Plane &p)

## Detailed Description

Defines a plane in 3D space.

Remarks:
  A plane is defined in 3D space by the equation Ax + By + Cz + D = 0

  This equates to a vector (the normal of the plane, whose x, y and z components equate to the coefficients A, B and C respectively), and a constant (D) which is the distance along the normal you have to go to move the plane back to the origin.

Definition at line 49 of file OgrePlane.h.

## Member Enumeration Documentation

enum Ogre::Plane::Side

The "positive side" of the plane is the half space to which the plane normal points.

The "negative side" is the other half space. The flag "no side" indicates the plane itself.

Enumeration values:

  NO_SIDE |
  POSITIVE_SIDE |
  NEGATIVE_SIDE |

Definition at line 66 of file OgrePlane.h.

## Constructor & Destructor Documentation

Ogre::Plane::Plane | ( |  | ) |

| Default constructor - sets everything to 0. Definition at line 30 of file OgrePlane.cpp. References d, and normal.

Ogre::Plane::Plane | ( | const Plane & | rhs | ) |

| Definition at line 36 of file OgrePlane.cpp. References d, and normal.

Ogre::Plane::Plane | ( | const Vector3 & | rkNormal,
|  | Real | fConstant
| ) |

| Construct a plane through a normal, and a distance to move the plane along the normal. Definition at line 42 of file OgrePlane.cpp. References d, normal, and Ogre::Real.

Ogre::Plane::Plane | ( | const Vector3 & | rkNormal,
|  | const Vector3 & | rkPoint
| ) |

| Definition at line 48 of file OgrePlane.cpp. References d, Ogre::Vector3::dotProduct(), and normal.

Ogre::Plane::Plane | ( | const Vector3 & | rkPoint0,
|  | const Vector3 & | rkPoint1,
|  | const Vector3 & | rkPoint2
| ) |

| Definition at line 54 of file OgrePlane.cpp. References redefine().

## Member Function Documentation

Real Ogre::Plane::getDistance | ( | const Vector3 & | rkPoint | ) | const

This is a pseudodistance.

The sign of the return value is positive if the point is on the positive side of the plane, negative if the point is on the negative side, and zero if the point is on the plane.

The absolute value of the return value is the true distance only when the plane normal is a unit length vector.

Definition at line 60 of file OgrePlane.cpp.

References d, Ogre::Vector3::dotProduct(), normal, and Ogre::Real.

Referenced by Ogre::BspNode::getDistance(), getSide(), Ogre::OctreeCamera::getVisibility(), Ogre::intersect(), Ogre::PlaneBoundedVolume::intersects(), Ogre::Frustum::isVisible(), and Ogre::BspSceneManager::processVisibleLeaf().

Plane::Side Ogre::Plane::getSide | ( | const Vector3 & | rkPoint | ) | const

| Definition at line 65 of file OgrePlane.cpp. References getDistance(), and Ogre::Real. Referenced by Ogre::BspNode::getSide(), Ogre::PlaneBoundedVolume::intersects(), Ogre::Math::intersects(), and Ogre::Frustum::isVisible().

bool Ogre::Plane::operator== | ( | const Plane & | rhs | ) | const

| Comparison operator. Definition at line 92 of file OgrePlane.h. References d, and normal.

void Ogre::Plane::redefine | ( | const Vector3 & | rkPoint0,
|  | const Vector3 & | rkPoint1,
|  | const Vector3 & | rkPoint2
| ) |

| Redefine this plane based on 3 points. Definition at line 78 of file OgrePlane.cpp. References Ogre::Vector3::crossProduct(), d, Ogre::Vector3::dotProduct(), normal, and Ogre::Vector3::normalise(). Referenced by Ogre::TerrainRenderable::_calculateMinLevelDist2(), and Plane().

## Friends And Related Function Documentation

_OgreExport friend std::ostream& operator<< | ( | std::ostream & | o,
|  | Plane & | p
| ) | `[friend]`

| Definition at line 88 of file OgrePlane.cpp.

## Member Data Documentation

Real Ogre::Plane::d

Definition at line 90 of file OgrePlane.h.

Referenced by Ogre::GLRenderSystem::_applyObliqueDepthProjection(), Ogre::D3D9RenderSystem::_applyObliqueDepthProjection(), Ogre::D3DRenderSystem::_applyObliqueDepthProjection(), Ogre::TerrainRenderable::_calculateMinLevelDist2(), Ogre::MovablePlane::_getDerivedPlane(), Ogre::Light::_getFrustumClipVolumes(), Ogre::Math::buildReflectionMatrix(), Ogre::MeshManager::createCurvedIllusionPlane(), Ogre::MeshManager::createCurvedPlane(), Ogre::MeshManager::createPlane(), Ogre::SceneManager::createSkyboxPlane(), Ogre::SceneManager::createSkydomePlane(), getDistance(), Ogre::Math::intersects(), Ogre::BspLevel::loadQuake3Level(), Ogre::Matrix4::operator *(), Ogre::operator<<(), operator==(), Plane(), redefine(), Ogre::RenderSystem::setClipPlane(), Ogre::GLRenderSystem::setClipPlanes(), Ogre::D3D9RenderSystem::setClipPlanes(), Ogre::D3DRenderSystem::setClipPlanes(), and Ogre::Frustum::updateView().

Vector3 Ogre::Plane::normal

Definition at line 89 of file OgrePlane.h.

Referenced by Ogre::GLRenderSystem::_applyObliqueDepthProjection(), Ogre::D3D9RenderSystem::_applyObliqueDepthProjection(), Ogre::D3DRenderSystem::_applyObliqueDepthProjection(), Ogre::TerrainRenderable::_calculateMinLevelDist2(), Ogre::MovablePlane::_getDerivedPlane(), Ogre::Light::_getFrustumClipVolumes(), Ogre::Math::buildReflectionMatrix(), Ogre::MeshManager::createCurvedIllusionPlane(), Ogre::MeshManager::createCurvedPlane(), Ogre::MeshManager::createPlane(), Ogre::SceneManager::createSkyboxPlane(), Ogre::SceneManager::createSkydomePlane(), Ogre::Frustum::disableReflection(), Ogre::Frustum::Frustum(), getDistance(), Ogre::Math::intersects(), Ogre::BspLevel::loadQuake3Level(), Ogre::Matrix4::operator *(), Ogre::operator<<(), operator==(), Plane(), redefine(), Ogre::RenderSystem::setClipPlane(), Ogre::GLRenderSystem::setClipPlanes(), Ogre::D3D9RenderSystem::setClipPlanes(), Ogre::D3DRenderSystem::setClipPlanes(), Ogre::SceneManager::setSkyPlane(), and Ogre::Frustum::updateView().

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

- OgrePlane.h
- OgrePlane.cpp

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