#include <K3dConvex.h>
Inheritance diagram for K3dConvex:
Public Member Functions | |
K3dConvex (K3dGameData *_pGameData) | |
~K3dConvex () | |
void | InitConvex () |
Convex class initialization. | |
K3dPolyObj * | CreatePolyFromVertexArray (const TVertexArray &_rvVertex) |
Create polyhedron from input vertex array. | |
K3dPlaneObj * | GetEdgePlane () |
Private Member Functions | |
bool | CheckConvexPlane () |
Check if plane is convex plane. Convex plane has vertices on plane or back side of the plane. | |
void | CreateConvexPlane (const K3dVector3Obj &_rkV0, const K3dVector3Obj &_rkV1, const K3dVector3Obj &_rkV2) |
Create convex plane from three vertices. | |
void | CheckEdge (const K3dVector3Obj *_pV0, const K3dVector3Obj *_pV1) |
If all other vertices are on front or back plane side, than add edge to the edge array. | |
void | CreateOnPlaneEdges () |
Create edges from on plane vertices. | |
void | CreateEdgesFromVertexArray () |
Create polyhedron edges from vertex array. | |
void | CreateResultVertexArray () |
Compare vertex array with all edges and if vertex is equal with one of edge origin or direction vector add this vertex to result vertex array. | |
Private Attributes | |
K3dGameData * | m_pGameData |
Global game data, data centered game system. | |
TPolyPlaneArray | m_vPolyPlane |
Polyhedron plane array. | |
TLineArray | m_vEdge |
Edge array. | |
TVertexArray | m_vVertex |
Vertex array. | |
K3dPolyPlane * | m_pPolyPlane |
Polyhedron plane. | |
K3dPlaneObj * | m_pEdgePlane |
Edge plane. |
Definition at line 47 of file K3dConvex.h.
K3dConvex::K3dConvex | ( | K3dGameData * | _pGameData | ) |
Definition at line 38 of file K3dConvex.cpp.
References InitConvex(), m_pEdgePlane, m_pGameData, m_pPolyPlane, m_vEdge, m_vPolyPlane, and m_vVertex.
K3dConvex::~K3dConvex | ( | ) |
Definition at line 49 of file K3dConvex.cpp.
bool K3dConvex::CheckConvexPlane | ( | ) | [private] |
Check if plane is convex plane. Convex plane has vertices on plane or back side of the plane.
bool | True if vertices are on plane or on the back side of the plane. False if any vertex is on the front side. |
Definition at line 64 of file K3dConvex.cpp.
References K3dSceneData::GetIntersection(), K3dPolyPlane::GetOnPlaneVertexArray(), K3dPlane::GetPosition(), m_pGameData, m_pPolyPlane, m_vVertex, and K3dDistance::PointPlane().
Referenced by CreateConvexPlane().
void K3dConvex::CreateConvexPlane | ( | const K3dVector3Obj & | _rkV0, | |
const K3dVector3Obj & | _rkV1, | |||
const K3dVector3Obj & | _rkV2 | |||
) | [private] |
Create convex plane from three vertices.
_rkV0 | First vertex on the plane | |
_rkV1 | Second vertex on the plane | |
_rkV2 | Third vertex on the plane |
Definition at line 94 of file K3dConvex.cpp.
References CheckConvexPlane(), K3dPlaneWork::ComparePlane(), K3dPolyPlaneBuild::CreateNewPolyPlaneObj(), K3dPlane::GetDistance(), K3dSceneData::GetPlaneWork(), K3dSceneData::GetPolyPlaneBuild(), m_pGameData, m_pPolyPlane, and m_vPolyPlane.
Referenced by CreatePolyFromVertexArray().
void K3dConvex::CheckEdge | ( | const K3dVector3Obj * | _pV0, | |
const K3dVector3Obj * | _pV1 | |||
) | [private] |
If all other vertices are on front or back plane side, than add edge to the edge array.
Definition at line 114 of file K3dConvex.cpp.
References K3dLineBuild::CreateNewLineObj(), K3dSceneData::GetIntersection(), K3dSceneData::GetLineBuild(), K3dPolyPlane::GetOnPlaneVertexArray(), m_pEdgePlane, m_pGameData, m_pPolyPlane, m_vEdge, and K3dDistance::PointPlane().
Referenced by CreateOnPlaneEdges().
void K3dConvex::CreateOnPlaneEdges | ( | ) | [private] |
Create edges from on plane vertices.
Definition at line 148 of file K3dConvex.cpp.
References K3dPlaneWork::CalcPlane(), CheckEdge(), K3dPlane::GetNormal(), K3dPolyPlane::GetOnPlaneVertexArray(), K3dSceneData::GetPlaneWork(), K3dSceneData::GetVector3Work(), m_pEdgePlane, m_pGameData, m_pPolyPlane, K3dVector3Work::Normalize(), and K3dVector3Work::UnitCross().
Referenced by CreateEdgesFromVertexArray().
void K3dConvex::CreateEdgesFromVertexArray | ( | ) | [private] |
Create polyhedron edges from vertex array.
Definition at line 173 of file K3dConvex.cpp.
References CreateOnPlaneEdges(), m_pPolyPlane, m_vEdge, and m_vPolyPlane.
Referenced by CreatePolyFromVertexArray().
void K3dConvex::CreateResultVertexArray | ( | ) | [private] |
Compare vertex array with all edges and if vertex is equal with one of edge origin or direction vector add this vertex to result vertex array.
Definition at line 187 of file K3dConvex.cpp.
References m_vEdge, and m_vVertex.
Referenced by CreatePolyFromVertexArray().
void K3dConvex::InitConvex | ( | ) |
Convex class initialization.
Definition at line 54 of file K3dConvex.cpp.
References K3dPlaneBuild::CreateNewPlaneObj(), K3dSafePointer< _T >::FindPointer(), K3dSceneData::GetPlaneBuild(), K3dGameData::GetPlaneObjSP(), m_pEdgePlane, and m_pGameData.
Referenced by K3dMngGeometry::InitMngGeometry(), and K3dConvex().
K3dPolyObj * K3dConvex::CreatePolyFromVertexArray | ( | const TVertexArray & | _rvVertex | ) |
Create polyhedron from input vertex array.
_rvVertex | Vertex array |
Definition at line 214 of file K3dConvex.cpp.
References K3dPolyWork::CheckPoly(), CreateConvexPlane(), CreateEdgesFromVertexArray(), K3dPolyBuild::CreateNewPolyObj(), CreateResultVertexArray(), K3dLineWork::DeleteDupLines(), K3dVertexWork::DeleteDupVerts(), K3dPoly::GetEdgeArray(), K3dSceneData::GetLineWork(), K3dPoly::GetPlaneArray(), K3dSceneData::GetPolyBuild(), K3dSceneData::GetPolyWork(), K3dPoly::GetVertexArray(), K3dSceneData::GetVertexWork(), m_pGameData, m_vEdge, m_vPolyPlane, m_vVertex, and K3dPolyWork::VisiblePoly().
Referenced by K3dTriangulation::Triangulate().
K3dPlaneObj* K3dConvex::GetEdgePlane | ( | ) | [inline] |
K3dGameData* K3dConvex::m_pGameData [private] |
Global game data, data centered game system.
Reimplemented in K3dScene, K3dMngGeometry, K3dMngSystem, K3dTools, and K3dTriangulation.
Definition at line 49 of file K3dConvex.h.
Referenced by CheckConvexPlane(), CheckEdge(), CreateConvexPlane(), CreateOnPlaneEdges(), CreatePolyFromVertexArray(), InitConvex(), and K3dConvex().
TPolyPlaneArray K3dConvex::m_vPolyPlane [private] |
Polyhedron plane array.
Definition at line 50 of file K3dConvex.h.
Referenced by CreateConvexPlane(), CreateEdgesFromVertexArray(), CreatePolyFromVertexArray(), and K3dConvex().
TLineArray K3dConvex::m_vEdge [private] |
Edge array.
Definition at line 51 of file K3dConvex.h.
Referenced by CheckEdge(), CreateEdgesFromVertexArray(), CreatePolyFromVertexArray(), CreateResultVertexArray(), and K3dConvex().
TVertexArray K3dConvex::m_vVertex [private] |
Vertex array.
Definition at line 52 of file K3dConvex.h.
Referenced by CheckConvexPlane(), CreatePolyFromVertexArray(), CreateResultVertexArray(), and K3dConvex().
K3dPolyPlane* K3dConvex::m_pPolyPlane [private] |
Polyhedron plane.
Definition at line 53 of file K3dConvex.h.
Referenced by CheckConvexPlane(), CheckEdge(), CreateConvexPlane(), CreateEdgesFromVertexArray(), CreateOnPlaneEdges(), and K3dConvex().
K3dPlaneObj* K3dConvex::m_pEdgePlane [private] |
Edge plane.
Definition at line 54 of file K3dConvex.h.
Referenced by CheckEdge(), CreateOnPlaneEdges(), GetEdgePlane(), InitConvex(), and K3dConvex().