#include <K3dObjectWork.h>
Inheritance diagram for K3dObjectWork:
Public Member Functions | |
K3dObjectWork (K3dGameData *_pGameData) | |
~K3dObjectWork (void) | |
int | FindObjectId (const char *_strName, const int _iObjType) |
Find object index in global data by ibject name and object type. | |
float | GetDistance (const int _iObjId0, const int _iObjId1, const int _iObjType0, const int _iObjType1) |
Calculate distance between Obj0 and Obj1 by object type. | |
bool | GetIntersection (const int _iObjId0, const int _iObjId1, const int _iObjType0, const int _iObjType1, K3dVector3 &_rkInrPoint) |
Test intersection between Obj0 and Obj1 and return intersection point. | |
bool | GetIntersection (const int _iObjId0, const int _iObjId1, const int _iObjType0, const int _iObjType1) |
Test intersection between Obj0 and Obj1. | |
void | SetColor (const int _iObjId, const int _iObjType, const char _r, const char _g, const char _b) |
Set object color. | |
void | Link (const int _iObjId0, const int _iObjId1, const int _iObjType0, const int _iObjType1) |
Link obj0 to the obj1 by object type. After linking obj0 will moving by obj1. | |
void | Hide (const int _iObjId, const int _iObjType, const bool _bHide) |
Hide or unhide current object. | |
Private Attributes | |
K3dGameData * | m_pGameData |
Global game data, data centered game system. | |
K3dIntersection * | m_pIntersection |
Pointer to intersection calculation. | |
K3dVertexBuild * | m_pVertexBuild |
Pointer to vertex builder. |
Definition at line 43 of file K3dObjectWork.h.
K3dObjectWork::K3dObjectWork | ( | K3dGameData * | _pGameData | ) |
Definition at line 35 of file K3dObjectWork.cpp.
References K3dSceneData::GetIntersection(), K3dSceneData::GetVertexBuild(), m_pGameData, m_pIntersection, and m_pVertexBuild.
K3dObjectWork::~K3dObjectWork | ( | void | ) |
Definition at line 46 of file K3dObjectWork.cpp.
int K3dObjectWork::FindObjectId | ( | const char * | _strName, | |
const int | _iObjType | |||
) |
Find object index in global data by ibject name and object type.
_strName | Object name | |
_iObjType | Object type |
int | Returns object index if object exists |
Definition at line 54 of file K3dObjectWork.cpp.
References K3dCameraWork::FindCameraId(), K3dLineWork::FindLineId(), K3dPlaneWork::FindPlaneId(), K3dRayWork::FindRayId(), K3dSphereWork::FindSphereId(), K3dVertexWork::FindVertexId(), K3dSceneData::GetPlaneWork(), K3D_CAMERA_OBJ, K3D_IMAGE_OBJ, K3D_LINE_OBJ, K3D_PLANE_OBJ, K3D_RAY_OBJ, K3D_SPHERE_OBJ, K3D_VERTEX_OBJ, m_pGameData, and m_pVertexBuild.
Referenced by K3dVM::GetObject().
float K3dObjectWork::GetDistance | ( | const int | _iObjId0, | |
const int | _iObjId1, | |||
const int | _iObjType0, | |||
const int | _iObjType1 | |||
) |
Calculate distance between Obj0 and Obj1 by object type.
_iObjId0 | First object index | |
_iObjId1 | Second object index | |
_iObjType0 | First object type | |
_iObjType1 | Second object type |
float | Returns result distance. If some object doesn`t exists, then return -1 |
Definition at line 91 of file K3dObjectWork.cpp.
References K3dSafePointer< _T >::Get(), K3dGameData::GetCameraObjSP(), K3dCamera::GetCameraPos(), K3dSphere::GetPosition(), K3dGameData::GetSphereObjSP(), K3D_CAMERA_OBJ, K3D_IMAGE_OBJ, K3D_LINE_OBJ, K3D_PLANE_OBJ, K3D_RAY_OBJ, K3D_SPHERE_OBJ, K3D_VERTEX_OBJ, m_pGameData, m_pIntersection, and K3dDistance::Points().
Referenced by K3dVM::GetDistance().
bool K3dObjectWork::GetIntersection | ( | const int | _iObjId0, | |
const int | _iObjId1, | |||
const int | _iObjType0, | |||
const int | _iObjType1, | |||
K3dVector3 & | _rkInrPoint | |||
) |
Test intersection between Obj0 and Obj1 and return intersection point.
_iObjId0 | First object index | |
_iObjId1 | Second object index | |
_iObjType0 | First object type | |
_iObjType1 | Second object type |
_rkInrPoint | If we want intersection point then return it | |
bool | True if Obj0 intersect Obj1 |
Definition at line 190 of file K3dObjectWork.cpp.
References K3dIntrLinePlane::GetIntrPoint(), K3D_CAMERA_OBJ, K3D_IMAGE_OBJ, K3D_LINE_OBJ, K3D_PLANE_OBJ, K3D_RAY_OBJ, K3D_SPHERE_OBJ, K3D_VERTEX_OBJ, and m_pIntersection.
Referenced by K3dVM::GetIntersection().
bool K3dObjectWork::GetIntersection | ( | const int | _iObjId0, | |
const int | _iObjId1, | |||
const int | _iObjType0, | |||
const int | _iObjType1 | |||
) |
Test intersection between Obj0 and Obj1.
_iObjId0 | First object index | |
_iObjId1 | Second object index | |
_iObjType0 | First object type | |
_iObjType1 | Second object type |
bool | True if Obj0 intersect Obj1 |
Definition at line 138 of file K3dObjectWork.cpp.
References K3dSafePointer< _T >::Get(), K3dGameData::GetLineObjSP(), K3dGameData::GetPlaneObjSP(), K3dGameData::GetRayObjSP(), K3dGameData::GetSphereObjSP(), K3D_CAMERA_OBJ, K3D_IMAGE_OBJ, K3D_LINE_OBJ, K3D_PLANE_OBJ, K3D_RAY_OBJ, K3D_SPHERE_OBJ, K3D_VERTEX_OBJ, K3dIntrLinePlane::LinePlane(), m_pGameData, m_pIntersection, and K3dIntrLinSph::RaySphere().
void K3dObjectWork::SetColor | ( | const int | _iObjId, | |
const int | _iObjType, | |||
const char | _r, | |||
const char | _g, | |||
const char | _b | |||
) |
Set object color.
_iObjId | Object index | |
_iObjType | Object type | |
_r | Red color | |
_g | Green color | |
_b | Blue color |
Definition at line 227 of file K3dObjectWork.cpp.
References K3dSafePointer< _T >::Get(), K3dColor3::GetB(), K3dSphereVis::GetColor(), K3dColor3::GetG(), K3dColor3::GetR(), K3dGameData::GetSphereObjSP(), K3D_CAMERA_OBJ, K3D_IMAGE_OBJ, K3D_LINE_OBJ, K3D_PLANE_OBJ, K3D_RAY_OBJ, K3D_SPHERE_OBJ, K3D_VERTEX_OBJ, and m_pGameData.
Referenced by K3dVM::SetColor().
void K3dObjectWork::Link | ( | const int | _iObjId0, | |
const int | _iObjId1, | |||
const int | _iObjType0, | |||
const int | _iObjType1 | |||
) |
Link obj0 to the obj1 by object type. After linking obj0 will moving by obj1.
_iObjId0 | First object index | |
_iObjId1 | Second object index | |
_iObjType0 | First object type | |
_iObjType1 | Second object type |
Definition at line 260 of file K3dObjectWork.cpp.
References K3D_CAMERA_OBJ, K3D_IMAGE_OBJ, K3D_LINE_OBJ, K3D_PLANE_OBJ, K3D_RAY_OBJ, K3D_SPHERE_OBJ, K3D_VERTEX_OBJ, and K3dSphereWork::LinkObject().
Referenced by K3dVM::Link().
void K3dObjectWork::Hide | ( | const int | _iObjId, | |
const int | _iObjType, | |||
const bool | _bHide | |||
) |
Hide or unhide current object.
_iObjId | Current object index | |
_iObjType | Object type | |
_bHide | If true then hide current object |
Definition at line 290 of file K3dObjectWork.cpp.
References K3dSafePointer< _T >::Get(), K3dPlaneObj::GetIsVisible(), K3dLineObj::GetIsVisible(), K3dVertexObj::GetIsVisible(), K3dGameData::GetLineObjSP(), K3dGameData::GetPlaneObjSP(), K3dGameData::GetVertexObjSP(), K3D_CAMERA_OBJ, K3D_IMAGE_OBJ, K3D_LINE_OBJ, K3D_PLANE_OBJ, K3D_RAY_OBJ, K3D_SPHERE_OBJ, K3D_VERTEX_OBJ, and m_pGameData.
Referenced by K3dVM::Hide().
K3dGameData* K3dObjectWork::m_pGameData [private] |
Global game data, data centered game system.
Reimplemented from K3dCameraWork.
Reimplemented in K3dObjectBuild, K3dScene, K3dMngGeometry, and K3dMngSystem.
Definition at line 49 of file K3dObjectWork.h.
Referenced by FindObjectId(), GetDistance(), GetIntersection(), Hide(), K3dObjectWork(), and SetColor().
K3dIntersection* K3dObjectWork::m_pIntersection [private] |
Pointer to intersection calculation.
Reimplemented from K3dSphereWork.
Definition at line 50 of file K3dObjectWork.h.
Referenced by GetDistance(), GetIntersection(), and K3dObjectWork().
K3dVertexBuild* K3dObjectWork::m_pVertexBuild [private] |
Pointer to vertex builder.
Definition at line 51 of file K3dObjectWork.h.
Referenced by FindObjectId(), and K3dObjectWork().