K3dObjectWork Class Reference

#include <K3dObjectWork.h>

Inheritance diagram for K3dObjectWork:

K3dCameraWork K3dRayWork K3dLineWork K3dSphereWork K3dObjectBuild K3dMngGeometry K3dMngSystem K3dScene List of all members.

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

K3dGameDatam_pGameData
 Global game data, data centered game system.
K3dIntersectionm_pIntersection
 Pointer to intersection calculation.
K3dVertexBuildm_pVertexBuild
 Pointer to vertex builder.

Detailed Description

Definition at line 43 of file K3dObjectWork.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

int K3dObjectWork::FindObjectId ( const char *  _strName,
const int  _iObjType 
)

Find object index in global data by ibject name and object type.

Parameters:
_strName Object name
_iObjType Object type
Return values:
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.

Parameters:
_iObjId0 First object index
_iObjId1 Second object index
_iObjType0 First object type
_iObjType1 Second object type
Return values:
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.

Parameters:
_iObjId0 First object index
_iObjId1 Second object index
_iObjType0 First object type
_iObjType1 Second object type
Return values:
_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.

Parameters:
_iObjId0 First object index
_iObjId1 Second object index
_iObjType0 First object type
_iObjType1 Second object type
Return values:
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.

Parameters:
_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.

Parameters:
_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.

Parameters:
_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().


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated on Thu Aug 16 23:53:33 2007 for K3dEngine by  doxygen 1.5.0