#include <K3dPlaneWork.h>
Inheritance diagram for K3dPlaneWork:
Public Member Functions | |
K3dPlaneWork (K3dGameData *_pGameData) | |
~K3dPlaneWork () | |
void | Init (K3dPlaneObj *_pPlane) |
Init plane. | |
void | CalcDistance (K3dPlaneObj *_pPlane) |
Calculate plane distance. | |
void | CalcPlane (K3dPlaneObj *_pPlane, const K3dVector3Obj &_rkPosition, const K3dVector3Obj &_rkNormal) |
Calculate plane from position and normal vector. | |
void | CalcPlane (K3dPlaneObj *_pPlane, const K3dVector3Obj &_rkV0, const K3dVector3Obj &_rkV1, const K3dVector3Obj &_rkV2) |
Calculate plane from three vectors. | |
void | UpdateMatrix (K3dPlaneObj *_pPlane) |
Set position, rotation matrix, normal, distance and vertex array from render matrix. | |
int | FindPlaneId (const char *_strName) |
Find plane index in global plane data by plane name. | |
void | UpdatePlanes () |
Update planes. | |
void | CheckPlane (const int _iPlaneId) |
Check plane variables. | |
bool | ComparePlane (const K3dPlaneObj *_pPlane, const TPlaneArray &_rPlaneArray) |
bool | ComparePlane (K3dPolyPlane *_pPlane, const TPolyPlaneArray &_rPlaneArray) |
Compare plane with plane array. | |
void | CalcVertexArray (K3dPlaneObj *_pPlane) |
Calcutale vertex array for plane visualization. | |
Private Attributes | |
K3dGameData * | m_pGameData |
Global game data, data centered game system. | |
K3dVector3Work * | m_pVector3Work |
Pointer to 3d vector worker. |
Definition at line 44 of file K3dPlaneWork.h.
K3dPlaneWork::K3dPlaneWork | ( | K3dGameData * | _pGameData | ) |
Definition at line 36 of file K3dPlaneWork.cpp.
References K3dSceneData::GetVector3Work(), m_pGameData, m_pVector3Work, and K3dSceneData::SetPlaneWork().
K3dPlaneWork::~K3dPlaneWork | ( | ) |
Definition at line 44 of file K3dPlaneWork.cpp.
void K3dPlaneWork::Init | ( | K3dPlaneObj * | _pPlane | ) |
Init plane.
Definition at line 123 of file K3dPlaneWork.cpp.
References CalcDistance(), CalcVertexArray(), K3dPlane::GetNormal(), K3dPlane::GetPosition(), K3dPlaneMove::GetRelNormal(), and K3dPlaneMove::GetRelPosition().
Referenced by K3dCutPoly::AddNewPlane(), CalcPlane(), K3dPlaneBuild::LoadPlanes(), and K3dVorBsp::SetPlane().
void K3dPlaneWork::CalcDistance | ( | K3dPlaneObj * | _pPlane | ) |
Calculate plane distance.
Definition at line 117 of file K3dPlaneWork.cpp.
References K3dVector3Work::Dot(), K3dPlane::GetDistance(), K3dPlane::GetNormal(), K3dPlane::GetPosition(), and m_pVector3Work.
Referenced by Init(), K3dVorBsp::MovePlane(), and UpdateMatrix().
void K3dPlaneWork::CalcPlane | ( | K3dPlaneObj * | _pPlane, | |
const K3dVector3Obj & | _rkPosition, | |||
const K3dVector3Obj & | _rkNormal | |||
) |
Calculate plane from position and normal vector.
_pPlane | Input outpu plane | |
_rkPosition | New plane position | |
_rkNormal | New plane normal |
Definition at line 135 of file K3dPlaneWork.cpp.
References K3dPlane::GetNormal(), K3dPlane::GetPosition(), and Init().
Referenced by K3dCutPoly::CalcNewEdges(), K3dPlaneBuild::CreateNewPlaneObj(), K3dPolyPlaneBuild::CreateNewPolyPlaneObj(), K3dConvex::CreateOnPlaneEdges(), K3dIntersection::LineTriangle(), K3dSphereWork::MoveByMouse(), and K3dIntersection::RayTriangle().
void K3dPlaneWork::CalcPlane | ( | K3dPlaneObj * | _pPlane, | |
const K3dVector3Obj & | _rkV0, | |||
const K3dVector3Obj & | _rkV1, | |||
const K3dVector3Obj & | _rkV2 | |||
) |
Calculate plane from three vectors.
_pPlane | Input outpu plane | |
_rkV0 | First new plane position | |
_rkV1 | Second new plane position | |
_rkV2 | Third new plane position |
Definition at line 147 of file K3dPlaneWork.cpp.
References K3dPlane::GetNormal(), K3dPlane::GetPosition(), Init(), m_pVector3Work, K3dVector3Work::Normal(), and K3dVector3Work::Normalize().
void K3dPlaneWork::UpdateMatrix | ( | K3dPlaneObj * | _pPlane | ) |
Set position, rotation matrix, normal, distance and vertex array from render matrix.
_pPlane | Input outpu plane |
Definition at line 162 of file K3dPlaneWork.cpp.
References CalcDistance(), K3dMatrix::ChangeVectorGL(), K3dPlaneMove::GetMatrix(), K3dPlane::GetNormal(), K3dPlane::GetPosition(), K3dPlaneMove::GetRelNormal(), K3dPlaneMove::GetRelPosition(), K3dPlaneMove::GetRotMatrix(), K3dMatrix::GetTranslation(), and K3dMatrix::ResetTranslation().
Referenced by UpdatePlanes().
int K3dPlaneWork::FindPlaneId | ( | const char * | _strName | ) |
Find plane index in global plane data by plane name.
Definition at line 179 of file K3dPlaneWork.cpp.
References K3dSafePointer< _T >::Get(), K3dSafePointer< _T >::GetNum(), K3dGameData::GetPlaneObjSP(), and m_pGameData.
Referenced by K3dObjectWork::FindObjectId().
void K3dPlaneWork::UpdatePlanes | ( | ) |
Update planes.
Definition at line 194 of file K3dPlaneWork.cpp.
References K3dSafePointer< _T >::Get(), K3dSafePointer< _T >::GetNum(), K3dGameData::GetPlaneObjSP(), m_pGameData, and UpdateMatrix().
Referenced by K3dMngGeometry::UpdateMngGeometry().
void K3dPlaneWork::CheckPlane | ( | const int | _iPlaneId | ) |
Check plane variables.
_iPlaneId | Plane index |
Definition at line 204 of file K3dPlaneWork.cpp.
References K3dSafePointer< _T >::Get(), K3dPlane::GetDistance(), K3dPlaneObj::GetId(), K3dPlaneObj::GetIsVisible(), K3dPlane::GetNormal(), K3dGameData::GetPlaneObjSP(), K3dPlane::GetPosition(), K3dPlaneVis::GetVertexArray(), K3dVector3::GetX(), K3dVector3::GetY(), K3dVector3::GetZ(), and m_pGameData.
bool K3dPlaneWork::ComparePlane | ( | const K3dPlaneObj * | _pPlane, | |
const TPlaneArray & | _rPlaneArray | |||
) |
Referenced by K3dConvex::CreateConvexPlane().
bool K3dPlaneWork::ComparePlane | ( | K3dPolyPlane * | _pPlane, | |
const TPolyPlaneArray & | _rPlaneArray | |||
) |
Compare plane with plane array.
*_pPlane | Compared plane | |
&_rPlaneArray | Compared plane array |
bool | True if plane is exists in plane array, false if doesn`t exists |
Definition at line 239 of file K3dPlaneWork.cpp.
References K3dSceneData::GetIntersection(), K3dPlane::GetNormal(), K3dPlane::GetPosition(), m_pGameData, and K3dDistance::PointPlane().
void K3dPlaneWork::CalcVertexArray | ( | K3dPlaneObj * | _pPlane | ) |
Calcutale vertex array for plane visualization.
Definition at line 49 of file K3dPlaneWork.cpp.
References K3dVector3Work::Cross(), K3dVector3Work::Dot(), K3dPlaneVis::GetHeight(), K3dPlane::GetNormal(), K3dPlane::GetPosition(), K3dPlaneVis::GetVertexArray(), K3dPlaneVis::GetWidth(), K3dVector3Work::Length(), m_pVector3Work, and K3dVector3Work::UnitCross().
Referenced by Init().
K3dGameData* K3dPlaneWork::m_pGameData [private] |
Global game data, data centered game system.
Reimplemented in K3dObjectBuild, K3dPlaneBuild, K3dScene, K3dMngGeometry, and K3dMngSystem.
Definition at line 46 of file K3dPlaneWork.h.
Referenced by CheckPlane(), ComparePlane(), FindPlaneId(), K3dPlaneWork(), and UpdatePlanes().
K3dVector3Work* K3dPlaneWork::m_pVector3Work [private] |
Pointer to 3d vector worker.
Definition at line 47 of file K3dPlaneWork.h.
Referenced by CalcDistance(), CalcPlane(), CalcVertexArray(), and K3dPlaneWork().