OGRE 14.3
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. | |
Plane (const Vector3 &p0, const Vector3 &p1, const Vector3 &p2) | |
Plane (const Vector3 &rkNormal, const Vector3 &rkPoint) | |
Plane (const Vector3 &rkNormal, Real fConstant) | |
Construct a plane through a normal, and a distance to move the plane along the normal. | |
Plane (const Vector4 &v) | |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Plane (Real a, Real b, Real c, Real _d) | |
Construct a plane using the 4 constants directly. | |
Real | getDistance (const Vector3 &rkPoint) const |
This is a pseudodistance. | |
Side | getSide (const AxisAlignedBox &box) const |
Returns the side where the alignedBox is. | |
Side | getSide (const Vector3 ¢re, const Vector3 &halfSize) const |
Returns which side of the plane that the given box lies on. | |
Side | getSide (const Vector3 &rkPoint) const |
Real | normalise (void) |
Normalises the plane. | |
bool | operator!= (const Plane &rhs) const |
Plane | operator- () const |
Get flipped plane, with same location but reverted orientation. | |
bool | operator== (const Plane &rhs) const |
Comparison operator. | |
Vector3 | projectVector (const Vector3 &v) const |
Project a vector onto the plane. | |
void | redefine (const Vector3 &p0, const Vector3 &p1, const Vector3 &p2) |
Redefine this plane based on 3 points. | |
void | redefine (const Vector3 &rkNormal, const Vector3 &rkPoint) |
Redefine this plane based on a normal and a point. | |
Public Attributes | |
Real | d |
Vector3 | normal |
Defines a plane in 3D space.
A plane is defined in 3D space by the equation
|
inline |
Default constructor - sets everything to 0.
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 an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References NEGATIVE_SIDE, NO_SIDE, and POSITIVE_SIDE.
Referenced by Ogre::PlaneBoundedVolume::intersects(), and Ogre::Math::intersects().
|
inline |
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. |
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.
References Ogre::Vector< dims, T >::dotProduct().
Referenced by Ogre::Sphere::intersects(), and Ogre::PlaneBoundedVolume::intersects().
Redefine this plane based on 3 points.
References Ogre::Math::calculateBasicFaceNormal(), and Ogre::Vector< dims, T >::dotProduct().
Redefine this plane based on a normal and a point.
Project a vector onto the plane.
v | The input vector |
Normalises the plane.
This method normalises the plane's normal and the length scale of d is as well.
References Ogre::Vector< dims, T >::length().
|
inline |
Get flipped plane, with same location but reverted orientation.
Vector3 Ogre::Plane::normal |
Real Ogre::Plane::d |