OGRE-Next  2.3
Object-Oriented Graphics Rendering Engine
Ogre::PCPlane Class Reference

#include <OgrePCPlane.h>

+ Inheritance diagram for Ogre::PCPlane:

Public Types

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

Public Member Functions

 PCPlane ()
 Standard constructor. More...
 
 PCPlane (const Plane &plane)
 Alternative constructor. More...
 
 PCPlane (const Vector3 &rkNormal, const Vector3 &rkPoint)
 Alternative constructor. More...
 
 PCPlane (const Vector3 &rkPoint0, const Vector3 &rkPoint1, const Vector3 &rkPoint2)
 Alternative constructor. More...
 
 ~PCPlane ()
 Standard destructor. More...
 
Real getDistance (const Vector3 &rkPoint) const
 This is a pseudodistance. More...
 
PortalBasegetPortal ()
 Returns the Portal that was used to create this plane. More...
 
Side getSide (const AxisAlignedBox &rkBox) const
 Returns the side where the alignedBox is. More...
 
Side getSide (const Vector3 &centre, const Vector3 &halfSize) const
 Returns which side of the plane that the given box lies on. More...
 
Side getSide (const Vector3 &rkPoint) const
 
Real normalise (void)
 Normalises the plane. More...
 
bool operator!= (const Plane &rhs) const
 
Plane operator- () const
 Get flipped plane, with same location but reverted orientation. More...
 
bool operator== (const Plane &rhs) const
 Comparison operator. More...
 
Vector3 projectVector (const Vector3 &v) const
 Project a vector onto the plane. More...
 
void redefine (const Vector3 &p0, const Vector3 &p1, const Vector3 &p2)
 Redefine this plane based on 3 points. More...
 
void redefine (const Vector3 &rkNormal, const Vector3 &rkPoint)
 Redefine this plane based on a normal and a point. More...
 
void setFromOgrePlane (Plane &ogrePlane)
 Copy from an Ogre Plane. More...
 
void setPortal (PortalBase *o)
 Sets the Portal that was used to create this plane. More...
 

Public Attributes

Real d
 
Vector3 normal
 

Member Enumeration Documentation

◆ Side

enum Ogre::Plane::Side
inherited

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.

Enumerator
NO_SIDE 
POSITIVE_SIDE 
NEGATIVE_SIDE 
BOTH_SIDE 

Constructor & Destructor Documentation

◆ PCPlane() [1/4]

Ogre::PCPlane::PCPlane ( )

Standard constructor.

◆ PCPlane() [2/4]

Ogre::PCPlane::PCPlane ( const Plane plane)

Alternative constructor.

◆ PCPlane() [3/4]

Ogre::PCPlane::PCPlane ( const Vector3 rkNormal,
const Vector3 rkPoint 
)

Alternative constructor.

◆ PCPlane() [4/4]

Ogre::PCPlane::PCPlane ( const Vector3 rkPoint0,
const Vector3 rkPoint1,
const Vector3 rkPoint2 
)

Alternative constructor.

◆ ~PCPlane()

Ogre::PCPlane::~PCPlane ( )

Standard destructor.

Member Function Documentation

◆ getDistance()

Real Ogre::Plane::getDistance ( const Vector3 rkPoint) const
inlineinherited

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.

References Ogre::Vector3::dotProduct().

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

◆ getPortal()

PortalBase* Ogre::PCPlane::getPortal ( )
inline

Returns the Portal that was used to create this plane.

◆ getSide() [1/3]

Side Ogre::Plane::getSide ( const AxisAlignedBox rkBox) const
inherited

Returns the side where the alignedBox is.

The flag BOTH_SIDE indicates an intersecting box. One corner ON the plane is sufficient to consider the box and the plane intersecting.

◆ getSide() [2/3]

Side Ogre::Plane::getSide ( const Vector3 centre,
const Vector3 halfSize 
) const
inherited

Returns which side of the plane that the given box lies on.

The box is defined as centre/half-size pairs for effectively.

Parameters
centreThe centre of the box.
halfSizeThe half-size of the box.
Returns
POSITIVE_SIDE if the box complete lies on the "positive side" of the plane, NEGATIVE_SIDE if the box complete lies on the "negative side" of the plane, and BOTH_SIDE if the box intersects the plane.

◆ getSide() [3/3]

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

◆ normalise()

Real Ogre::Plane::normalise ( void  )
inherited

Normalises the plane.

Remarks
This method normalises the plane's normal and the length scale of d is as well.
Note
This function will not crash for zero-sized vectors, but there will be no changes made to their components.
Returns
The previous length of the plane's normal.

◆ operator!=()

bool Ogre::Plane::operator!= ( const Plane rhs) const
inlineinherited

◆ operator-()

Plane Ogre::Plane::operator- ( ) const
inlineinherited

Get flipped plane, with same location but reverted orientation.

References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.

◆ operator==()

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

Comparison operator.

References Ogre::Plane::d, and Ogre::Plane::normal.

◆ projectVector()

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

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
vThe input vector

◆ redefine() [1/2]

void Ogre::Plane::redefine ( const Vector3 p0,
const Vector3 p1,
const Vector3 p2 
)
inlineinherited

Redefine this plane based on 3 points.

References Ogre::Vector3::dotProduct(), and Ogre::Vector3::normalisedCopy().

◆ redefine() [2/2]

void Ogre::Plane::redefine ( const Vector3 rkNormal,
const Vector3 rkPoint 
)
inlineinherited

Redefine this plane based on a normal and a point.

References Ogre::Vector3::dotProduct().

◆ setFromOgrePlane()

void Ogre::PCPlane::setFromOgrePlane ( Plane ogrePlane)

Copy from an Ogre Plane.

◆ setPortal()

void Ogre::PCPlane::setPortal ( PortalBase o)
inline

Sets the Portal that was used to create this plane.

Member Data Documentation

◆ d

◆ normal

Vector3 Ogre::Plane::normal
inherited

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