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

osg::Plane Class Reference

A plane class. More...

List of all members.

Public Methods

 Plane ()
 Plane (const Plane &pl)
 Plane (const float a, const float b, const float c, const float d)
 Plane (const Vec4 &vec)
 Plane (const Vec3 &norm, const float d)
 Plane (const Vec3 &v1, const Vec3 &v2, const Vec3 &v3)
Plane & operator= (const Plane &pl)
void set (const Plane &pl)
void set (const float a, const float b, const float c, const float d)
void set (const Vec4 &vec)
void set (const Vec3 &norm, const float d)
void set (const Vec3 &v1, const Vec3 &v2, const Vec3 &v3)
void flip ()
 flip/reverse the orientation of the plane.

void makeUnitLength ()
void calculateUpperLowerBBCorners ()
 calculate the upper and lower bounding box corners to be used in the intersect(BoundingBox&) method for speeding calculations.

const bool valid () const
Vec4asVec4 ()
const Vec4asVec4 () const
float & operator[] (const int i)
float operator[] (const int i) const
osg::Vec3 getNormal ()
const float distance (const osg::Vec3 &v) const
 calculate the distance between a point and the plane.

const int intersect (const std::vector< Vec3 > &vertices) const
 intersection test between plane and vertex list return 1 if the bs is completely above plane, return 0 if the bs intersects the plane, return -1 if the bs is completely below the plane.

const int intersect (const BoundingSphere &bs) const
 intersection test between plane and bounding sphere.

const int intersect (const BoundingBox &bb) const
 intersection test between plane and bounding sphere.

void transform (const osg::Matrix &matrix)
 Transform the plane by matrix.

void transformProvidingInverse (const osg::Matrix &matrix)
 Transform the plane by provide a pre inverted matrix.


Protected Attributes

Vec4 _fv
unsigned int _upperBBCorner
unsigned int _lowerBBCorner

Friends

std::ostream & operator<< (std::ostream &output, const Plane &pl)


Detailed Description

A plane class.

It can be used to represent an infinite plane.


Constructor & Destructor Documentation

osg::Plane::Plane   [inline]
 

osg::Plane::Plane const Plane &    pl [inline]
 

osg::Plane::Plane const float    a,
const float    b,
const float    c,
const float    d
[inline]
 

osg::Plane::Plane const Vec4   vec [inline]
 

osg::Plane::Plane const Vec3   norm,
const float    d
[inline]
 

osg::Plane::Plane const Vec3   v1,
const Vec3   v2,
const Vec3   v3
[inline]
 


Member Function Documentation

const Vec4& osg::Plane::asVec4   const [inline]
 

Vec4& osg::Plane::asVec4   [inline]
 

void osg::Plane::calculateUpperLowerBBCorners   [inline]
 

calculate the upper and lower bounding box corners to be used in the intersect(BoundingBox&) method for speeding calculations.

const float osg::Plane::distance const osg::Vec3   v const [inline]
 

calculate the distance between a point and the plane.

void osg::Plane::flip   [inline]
 

flip/reverse the orientation of the plane.

osg::Vec3 osg::Plane::getNormal   [inline]
 

const int osg::Plane::intersect const BoundingBox   bb const [inline]
 

intersection test between plane and bounding sphere.

return 1 if the bs is completely above plane, return 0 if the bs intersects the plane, return -1 if the bs is completely below the plane.

const int osg::Plane::intersect const BoundingSphere   bs const [inline]
 

intersection test between plane and bounding sphere.

return 1 if the bs is completely above plane, return 0 if the bs intersects the plane, return -1 if the bs is completely below the plane.

const int osg::Plane::intersect const std::vector< Vec3 > &    vertices const [inline]
 

intersection test between plane and vertex list return 1 if the bs is completely above plane, return 0 if the bs intersects the plane, return -1 if the bs is completely below the plane.

void osg::Plane::makeUnitLength   [inline]
 

Plane& osg::Plane::operator= const Plane &    pl [inline]
 

float osg::Plane::operator[] const int    i const [inline]
 

float& osg::Plane::operator[] const int    i [inline]
 

void osg::Plane::set const Vec3   v1,
const Vec3   v2,
const Vec3   v3
[inline]
 

void osg::Plane::set const Vec3   norm,
const float    d
[inline]
 

void osg::Plane::set const Vec4   vec [inline]
 

void osg::Plane::set const float    a,
const float    b,
const float    c,
const float    d
[inline]
 

void osg::Plane::set const Plane &    pl [inline]
 

void osg::Plane::transform const osg::Matrix   matrix [inline]
 

Transform the plane by matrix.

Note, this operations carries out the calculation of the inverse of the matrix since to transforms planes must be multiplied my the inverse transposed. This make this operation expensive. If the inverse has been already calculated elsewhere then use transformProvidingInverse() instead. See http://www.worldserver.com/turk/computergraphics/NormalTransformations.pdf

void osg::Plane::transformProvidingInverse const osg::Matrix   matrix [inline]
 

Transform the plane by provide a pre inverted matrix.

see transform for details.

const bool osg::Plane::valid   const [inline]
 


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &    output,
const Plane &    pl
[friend]
 


Member Data Documentation

Vec4 osg::Plane::_fv [protected]
 

unsigned int osg::Plane::_lowerBBCorner [protected]
 

unsigned int osg::Plane::_upperBBCorner [protected]
 


The documentation for this class was generated from the following file:
Generated at Wed Sep 18 13:55:36 2002 for the Open Scene Graph by doxygen 1.2.16.