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

Ogre::Plane Class Reference

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

#include <OgrePlane.h>

Inheritance diagram for Ogre::Plane:

Ogre::MovablePlane 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 Member Functions

 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.

Vector3 projectVector (const Vector3 &v)
 Project a vector onto the plane.

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.

Ogre::Plane::Plane const Plane rhs  ) 
 

Ogre::Plane::Plane const Vector3 rkNormal,
Real  fConstant
 

Construct a plane through a normal, and a distance to move the plane along the normal.

Ogre::Plane::Plane const Vector3 rkNormal,
const Vector3 rkPoint
 

Ogre::Plane::Plane const Vector3 rkPoint0,
const Vector3 rkPoint1,
const Vector3 rkPoint2
 


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.

Referenced by Ogre::PlaneBoundedVolume::intersects().

Side Ogre::Plane::getSide const Vector3 rkPoint  )  const
 

Referenced by Ogre::PlaneBoundedVolume::intersects().

bool Ogre::Plane::operator== const Plane rhs  )  const
 

Comparison operator.

Definition at line 101 of file OgrePlane.h.

References d, and normal.

Vector3 Ogre::Plane::projectVector const Vector3 v  ) 
 

Project a vector onto the plane.

Remarks:
This gives you the element of the input vector that is perpendicular to the normal of the plane. You can get the element which is parallel to the normal of the plane by subtracting the result of this method from the original vector, since parallel + perpendicular = original.
Parameters:
v The input vector

void Ogre::Plane::redefine const Vector3 rkPoint0,
const Vector3 rkPoint1,
const Vector3 rkPoint2
 

Redefine this plane based on 3 points.


Friends And Related Function Documentation

_OgreExport friend std::ostream& operator<< std::ostream &  o,
Plane p
[friend]
 


Member Data Documentation

Real Ogre::Plane::d
 

Definition at line 99 of file OgrePlane.h.

Referenced by Ogre::Matrix4::operator *(), and operator==().

Vector3 Ogre::Plane::normal
 

Definition at line 98 of file OgrePlane.h.

Referenced by Ogre::Matrix4::operator *(), and operator==().


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

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Mar 12 14:41:41 2006