OGRE
2.2.4
Object-Oriented Graphics Rendering Engine
|
Defines a plane in 3D space. More...
#include <OgrePlane.h>
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 | |
Plane () | |
Default constructor - sets everything to 0. More... | |
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. More... | |
Plane (Real a, Real b, Real c, Real d) | |
Construct a plane using the 4 constants directly. More... | |
Plane (const Vector3 &rkNormal, const Vector3 &rkPoint) | |
Plane (const Vector3 &rkPoint0, const Vector3 &rkPoint1, const Vector3 &rkPoint2) | |
Real | getDistance (const Vector3 &rkPoint) const |
This is a pseudodistance. More... | |
Side | getSide (const Vector3 &rkPoint) const |
Side | getSide (const AxisAlignedBox &rkBox) const |
Returns the side where the alignedBox is. More... | |
Side | getSide (const Vector3 ¢re, const Vector3 &halfSize) const |
Returns which side of the plane that the given box lies on. More... | |
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 &rkPoint0, const Vector3 &rkPoint1, const Vector3 &rkPoint2) |
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... | |
Public Attributes | |
Real | d |
Vector3 | normal |
Friends | |
_OgreExport friend std::ostream & | operator<< (std::ostream &o, const Plane &p) |
Defines a plane in 3D space.
enum Ogre::Plane::Side |
Ogre::Plane::Plane | ( | ) |
Default constructor - sets everything to 0.
Ogre::Plane::Plane | ( | const Plane & | rhs | ) |
Construct a plane through a normal, and a distance to move the plane along the normal.
Construct a plane using the 4 constants directly.
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.
Referenced by Ogre::PlaneBoundedVolume::intersects().
Referenced by Ogre::PlaneBoundedVolume::intersects().
Side Ogre::Plane::getSide | ( | const AxisAlignedBox & | rkBox | ) | const |
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.
Returns which side of the plane that the given box lies on.
The box is defined as centre/half-size pairs for effectively.
centre | The centre of the box. |
halfSize | The half-size of the box. |
Real Ogre::Plane::normalise | ( | void | ) |
Normalises the plane.
|
inline |
References d, normal, and Ogre::RTShader::operator<<().
|
inline |
Get flipped plane, with same location but reverted orientation.
References Ogre::Vector3::x, Ogre::Vector3::y, and Ogre::Vector3::z.
|
inline |
Project a vector onto the plane.
v | The input vector |
void Ogre::Plane::redefine | ( | const Vector3 & | rkPoint0, |
const Vector3 & | rkPoint1, | ||
const Vector3 & | rkPoint2 | ||
) |
Redefine this plane based on 3 points.
Redefine this plane based on a normal and a point.
|
friend |
Real Ogre::Plane::d |
Referenced by operator!=(), Ogre::Matrix4::operator*(), and operator==().
Vector3 Ogre::Plane::normal |
Referenced by operator!=(), Ogre::Matrix4::operator*(), and operator==().