#include <K3dDistance.h>
Inheritance diagram for K3dDistance:
Public Member Functions | |
K3dDistance (K3dGameData *_pGameData) | |
~K3dDistance () | |
float | Points (const K3dVector3Obj &_rkV0, const K3dVector3Obj &_rkV1) |
Calculate distance between two poins. | |
float | SqrPointRay (const K3dVector3Obj &_rkPoint, const K3dRay &_rkRay, float *_pfParam=NULL) |
Calculate squared distance between point and ray. | |
int | PointPlane (const K3dPlane &_rkPlane, const K3dVector3 &_rkPoint) |
By plane equation "Ax + By + Cz - D = 0" calculate point of plane distance A, B, C is normal vector of plane D is plane distance of origin x, y, z is any camera position on the plane Calculate distance between point and plane. | |
int | DistLinePlane (const K3dPlane &_rkPlane, const K3dVector3 &_rkLineOrigin, const K3dVector3 &_rkLineDirection) |
Calculate distance between line and plane. | |
Private Attributes | |
K3dGameData * | m_pGameData |
Global game data, data centered game system. |
Definition at line 41 of file K3dDistance.h.
K3dDistance::K3dDistance | ( | K3dGameData * | _pGameData | ) |
K3dDistance::~K3dDistance | ( | ) |
Definition at line 41 of file K3dDistance.cpp.
float K3dDistance::Points | ( | const K3dVector3Obj & | _rkV0, | |
const K3dVector3Obj & | _rkV1 | |||
) | [inline] |
Calculate distance between two poins.
Definition at line 49 of file K3dDistance.h.
References K3dSceneData::GetVector3Work(), K3dVector3Work::Length(), m_pGameData, and K3dVector3Work::VectorBetween().
Referenced by K3dObjectWork::GetDistance().
float K3dDistance::SqrPointRay | ( | const K3dVector3Obj & | _rkPoint, | |
const K3dRay & | _rkRay, | |||
float * | _pfParam = NULL | |||
) | [inline] |
Calculate squared distance between point and ray.
Definition at line 59 of file K3dDistance.h.
References K3dVector3Work::Dot(), K3dRay::GetDirection(), K3dRay::GetOrigin(), K3dSceneData::GetVector3Work(), m_pGameData, and K3dVector3Work::SquaredLength().
Referenced by K3dIntrLinSph::RaySphere().
int K3dDistance::PointPlane | ( | const K3dPlane & | _rkPlane, | |
const K3dVector3 & | _rkPoint | |||
) | [inline] |
By plane equation "Ax + By + Cz - D = 0" calculate point of plane distance A, B, C is normal vector of plane D is plane distance of origin x, y, z is any camera position on the plane Calculate distance between point and plane.
_rkPlane | Input plane | |
_rkPoint | Input point |
int | Rounded distance between point and plane |
Definition at line 99 of file K3dDistance.h.
References K3dPlane::GetDistance(), and K3dPlane::GetNormal().
Referenced by K3dVorBsp::CalcFrontBackVertices(), K3dCutPoly::CalcNewEdges(), K3dPolyPlaneBuild::CalcVertsOnPlane(), K3dConvex::CheckConvexPlane(), K3dConvex::CheckEdge(), K3dPlaneWork::ComparePlane(), K3dCutEdge::CutEdge(), K3dCutPoly::DeleteOpositePlane(), DistLinePlane(), K3dVorBsp::FindNearestVertex(), K3dIntrLinePlane::LinePlane(), and K3dIntersection::RayPlane().
int K3dDistance::DistLinePlane | ( | const K3dPlane & | _rkPlane, | |
const K3dVector3 & | _rkLineOrigin, | |||
const K3dVector3 & | _rkLineDirection | |||
) | [inline] |
Calculate distance between line and plane.
1 | If line lies on plane front side | |
-1 | If line lies on plane back side | |
-1 | If line intersect the plane |
Definition at line 115 of file K3dDistance.h.
References PointPlane(), and K3dMath::Sign().
Referenced by K3dCutPoly::DeleteOpositeEdges().
K3dGameData* K3dDistance::m_pGameData [private] |
Global game data, data centered game system.
Reimplemented in K3dIntersection, K3dIntrLinePlane, K3dIntrLinSph, K3dScene, and K3dMngSystem.
Definition at line 43 of file K3dDistance.h.
Referenced by K3dDistance(), Points(), and SqrPointRay().