Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::math::Plane Class Reference

#include <Plane.h>

Public Member Functions

 Plane ()
 Sazande e ke hich kari nemikone.
CollisionType Collision (const Sphere *pSphere) const
 Checks the plane collision with a sphere and returns ECT_Behind , ECT_Front or ECT_Intersect.
CollisionType Collision (const AABB *pBox) const
 Checks the plane collision with an AABB and returns ECT_Behind , ECT_Front or ECT_Intersect.
void Set (const Vector &vNormal, const Vector &vPoint)
void Set (const Vector &vNormal, const Vector &vPoint, float fDistance)
void Set (const Vector &v0, const Vector &v1, const Vector &v2)
void Set (float a, float b, float c, float d)
 Sakhtane Plane ba formole ax + bY +cz + d = 0.
float GetDistance (const Vector &vPoint) const
MatrixGetReflectMatrix ()
 Matrix Reflection ra sakhte va bar migardone.
MatrixGetShadowMatrix (Vector &vLightDir)
 Builds a matrix that flattens geometry into a plane.
void Normalize ()
 Normalize the plane.
bool GetIntersectionWithPlane (Plane *Other, Ray &outRay)
 Gets the intersection with another plane and return the line.
bool GetIntersectionWithLine (Ray *Other, Vector &outPoint)
 Gets the intersection with a line and return the intersected point.
bool GetIntersectionWithPlanes (Plane *o1, Plane *o2, Vector &outPoint)
 Gets the intersection with three planes and return the intersected point.
float DotCoord (const Vector &v) const
 Computes the dot product of a plane and a 3D vector. The w parameter of the vector is assumed to be 1.
float DotNormal (const Vector &v) const
 Computes the dot product of a plane and a 3D vector. The w parameter of the vector is assumed to be 0.

Public Attributes

Vector m_vNormal
float m_fDistance
float m_fA
float m_fB
float m_fC
float m_fD

Protected Member Functions

void CalcABCD ()
 Mohasebeye ax + by + cz + d = 0 ke bad az har bar estefade az tabe set be sorate automatic seda zade mishe.

Protected Attributes

Vector m_vPoint

Detailed Description

Definition at line 20 of file Plane.h.

Constructor & Destructor Documentation

kge::math::Plane::Plane ( )
inline

Sazande e ke hich kari nemikone.

Definition at line 28 of file Plane.h.

Member Function Documentation

void kge::math::Plane::CalcABCD ( )
inlineprotected

Mohasebeye ax + by + cz + d = 0 ke bad az har bar estefade az tabe set be sorate automatic seda zade mishe.

CollisionType kge::math::Plane::Collision ( const Sphere pSphere) const

Checks the plane collision with a sphere and returns ECT_Behind , ECT_Front or ECT_Intersect.

CollisionType kge::math::Plane::Collision ( const AABB pBox) const

Checks the plane collision with an AABB and returns ECT_Behind , ECT_Front or ECT_Intersect.

float kge::math::Plane::DotCoord ( const Vector v) const

Computes the dot product of a plane and a 3D vector. The w parameter of the vector is assumed to be 1.

float kge::math::Plane::DotNormal ( const Vector v) const

Computes the dot product of a plane and a 3D vector. The w parameter of the vector is assumed to be 0.

float kge::math::Plane::GetDistance ( const Vector vPoint) const
inline

Peyda kardane faseleye yek noghte ta safhe. NOTE: bordare Normal bayad normalize shode bashad.

Parameters
vPointNoghte e ke mikhahid faseleash ro ta safhe peyda konid.
Returns
Fasele noghte ta safhe.
bool kge::math::Plane::GetIntersectionWithLine ( Ray Other,
Vector outPoint 
)

Gets the intersection with a line and return the intersected point.

bool kge::math::Plane::GetIntersectionWithPlane ( Plane Other,
Ray outRay 
)

Gets the intersection with another plane and return the line.

bool kge::math::Plane::GetIntersectionWithPlanes ( Plane o1,
Plane o2,
Vector outPoint 
)

Gets the intersection with three planes and return the intersected point.

Matrix* kge::math::Plane::GetReflectMatrix ( )

Matrix Reflection ra sakhte va bar migardone.

Matrix* kge::math::Plane::GetShadowMatrix ( Vector vLightDir)

Builds a matrix that flattens geometry into a plane.

void kge::math::Plane::Normalize ( )

Normalize the plane.

void kge::math::Plane::Set ( const Vector vNormal,
const Vector vPoint 
)

Sakhte Plane ba yek noghte va bordare normal.

Parameters
vNormalBordare normal.
vPointMokhtasate noghte.
void kge::math::Plane::Set ( const Vector vNormal,
const Vector vPoint,
float  fDistance 
)

Sakhte Plane ba yek noghte va bordare normal va falseleye safhe ta markaze mokhtasat.

Parameters
vNormalBordare normal.
vPointMokhtasate noghte.
fDistanceFaseleye safhe ta markaze mokhtasat.
void kge::math::Plane::Set ( const Vector v0,
const Vector v1,
const Vector v2 
)

Sakhte safhe ba 3 ta noghte ya ye mosals(Polygon).

Parameters
v0Noghteye aval.
v1Noghteye dovom.
v2Noghteye Sevvom.
void kge::math::Plane::Set ( float  a,
float  b,
float  c,
float  d 
)

Sakhtane Plane ba formole ax + bY +cz + d = 0.

Member Data Documentation

float kge::math::Plane::m_fA

Definition at line 25 of file Plane.h.

float kge::math::Plane::m_fB

Definition at line 25 of file Plane.h.

float kge::math::Plane::m_fC

Definition at line 25 of file Plane.h.

float kge::math::Plane::m_fD

Definition at line 25 of file Plane.h.

float kge::math::Plane::m_fDistance

Definition at line 24 of file Plane.h.

Vector kge::math::Plane::m_vNormal

Definition at line 23 of file Plane.h.

Vector kge::math::Plane::m_vPoint
protected

Definition at line 90 of file Plane.h.


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