Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
Public Member Functions | Public Attributes
core::plane3d Class Reference

Template plane class with some intersection testing methods. More...

#include <Plane3d.h>

List of all members.

Public Member Functions

f32 getDistanceTo (const vector3d &point) const
bool getIntersectionWithLine (const vector3d &linePoint, const vector3d &lineVect, vector3d &outIntersection) const
bool getIntersectionWithPlane (const plane3d &other, vector3d &outLinePoint, vector3d &outLineVect) const
bool getIntersectionWithPlanes (const plane3d &o1, const plane3d &o2, vector3d &outPoint) const
 Returns the intersection point with two other planes if there is one.
vector3d getMemberPoint () const
 Returns a member point of the plane.
bool isFrontFacing (const vector3d &lookDirection) const
bool operator!= (const plane3d &other) const
bool operator== (const plane3d &other) const
 plane3d (const vector3d &MPoint, const vector3d &Normal)
 plane3d (f32 px, f32 py, f32 pz, f32 nx, f32 ny, f32 nz)
 plane3d (const plane3d &other)
 plane3d ()
 plane3d (const vector3d &point1, const vector3d &point2, const vector3d &point3)
void recalculateD (const vector3d &MPoint)
void setPlane (const vector3d &point1, const vector3d &point2, const vector3d &point3)
void setPlane (const vector3d &nvect, f32 d)
void setPlane (const vector3d &point, const vector3d &nvector)

Public Attributes

f32 D
vector3d Normal

Detailed Description

Template plane class with some intersection testing methods.


Constructor & Destructor Documentation

core::plane3d::plane3d ( )

References recalculateD().

core::plane3d::plane3d ( f32  px,
f32  py,
f32  pz,
f32  nx,
f32  ny,
f32  nz 
)

References recalculateD().

core::plane3d::plane3d ( const vector3d point1,
const vector3d point2,
const vector3d point3 
)

References setPlane().

core::plane3d::plane3d ( const vector3d MPoint,
const vector3d Normal 
)

References recalculateD().

core::plane3d::plane3d ( const plane3d other)

Member Function Documentation

f32 core::plane3d::getDistanceTo ( const vector3d point) const

Returns the distance to a point. Note that this only works if the normal is Normalized.

References D, core::vector3d::dotProduct(), and Normal.

bool core::plane3d::getIntersectionWithLine ( const vector3d linePoint,
const vector3d lineVect,
vector3d outIntersection 
) const

Returns an intersection with a 3d line.

Parameters:
lineVect,:Vector of the line to intersect with.
linePoint,:Point of the line to intersect with.
outIntersection,:Place to store the intersection point, if there is one.

References D, core::vector3d::dotProduct(), and Normal.

Referenced by getIntersectionWithPlanes().

bool core::plane3d::getIntersectionWithPlane ( const plane3d other,
vector3d outLinePoint,
vector3d outLineVect 
) const

Intersects this plane with another.

Parameters:
other,:Other plane to intersect with.
outLinePoint,:Base point of intersection line.
outLineVect,:Vector of intersection.

References core::abs(), core::vector3d::crossProduct(), D, core::vector3d::dotProduct(), core::EPSILON64, core::vector3d::getLength(), and Normal.

Referenced by getIntersectionWithPlanes().

bool core::plane3d::getIntersectionWithPlanes ( const plane3d o1,
const plane3d o2,
vector3d outPoint 
) const

Returns the intersection point with two other planes if there is one.

References getIntersectionWithLine(), and getIntersectionWithPlane().

Referenced by render::Frustum::buildViewFrustum().

vector3d core::plane3d::getMemberPoint ( ) const

Returns a member point of the plane.

References D, and Normal.

Referenced by core::matrix4::transformPlane().

bool core::plane3d::isFrontFacing ( const vector3d lookDirection) const

Returns if the plane is front of backfacing. Note that this only works if the normal is Normalized.

Parameters:
lookDirection,:Look direction.
Returns:
Returns true if the plane is front facing, which mean it would be visible, and false if it is backfacing.

References core::vector3d::dotProduct(), and Normal.

bool core::plane3d::operator!= ( const plane3d other) const [inline]

References D, core::EPSILON, and Normal.

bool core::plane3d::operator== ( const plane3d other) const [inline]

References D, core::EPSILON, and Normal.

void core::plane3d::recalculateD ( const vector3d MPoint)

Recalculates the distance from origin by applying a new member point to the plane.

References D, core::vector3d::dotProduct(), and Normal.

Referenced by plane3d(), and setPlane().

void core::plane3d::setPlane ( const vector3d nvect,
f32  d 
)

References D, and Normal.

void core::plane3d::setPlane ( const vector3d point,
const vector3d nvector 
)

References Normal, core::vector3d::normalize(), and recalculateD().

Referenced by plane3d().

void core::plane3d::setPlane ( const vector3d point1,
const vector3d point2,
const vector3d point3 
)

Member Data Documentation


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

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:07 by Doxygen (1.7.4)