#include <K3dSphereWork.h>
Inheritance diagram for K3dSphereWork:
Public Member Functions | |
K3dSphereWork (K3dGameData *_pGameData) | |
~K3dSphereWork () | |
void | InitSphereWork () |
Init sphere work variables. | |
void | MoveByMouse (const int _iSphereId) |
Move by mouse cursor. | |
void | UpdateSpheres () |
Sphere update. | |
void | LinkObject (const int _iSphereId, const int _iObjId, const int _iObjType) |
Link object defined by obj type to the sphere. | |
int | FindSphereId (const char *_strName) |
Find sphere index in global sphere data by sphere name. | |
int & | GetSphereId () |
Get sphere index. | |
K3dPlaneObj * | GetAimPlane () |
Get aiming plane. | |
void | SetAimPlane (K3dPlaneObj *_pPlane) |
Set aiming plane. | |
Private Attributes | |
K3dGameData * | m_pGameData |
Global game data, data centered game system. | |
int | m_iSphereId |
Sphere index. | |
ERotAxis | m_eRotAxis |
Rotation axis for rotation by mouse. | |
bool | m_bIsMouseRightUp |
Is right mouse button up? | |
K3dPlaneObj * | m_pPlane |
Aiming plane for moving by mouse function. | |
K3dIntersection * | m_pIntersection |
Pointer to intersection calculation. | |
K3dPlaneBuild * | m_pPlaneBuild |
Pointer to plane builder. |
Definition at line 54 of file K3dSphereWork.h.
K3dSphereWork::K3dSphereWork | ( | K3dGameData * | _pGameData | ) |
Definition at line 36 of file K3dSphereWork.cpp.
References K3dSceneData::GetIntersection(), K3dSceneData::GetPlaneBuild(), InitSphereWork(), K3D_ROT_AXIS_X, m_bIsMouseRightUp, m_eRotAxis, m_iSphereId, m_pGameData, m_pIntersection, m_pPlane, and m_pPlaneBuild.
K3dSphereWork::~K3dSphereWork | ( | ) |
Definition at line 48 of file K3dSphereWork.cpp.
void K3dSphereWork::InitSphereWork | ( | ) |
Init sphere work variables.
Definition at line 53 of file K3dSphereWork.cpp.
References K3dPlaneBuild::CreateNewPlaneObj(), K3dSafePointer< _T >::FindPointer(), K3dGameData::GetPlaneObjSP(), m_pGameData, m_pPlane, and m_pPlaneBuild.
Referenced by K3dMngGeometry::InitMngGeometry(), and K3dSphereWork().
void K3dSphereWork::MoveByMouse | ( | const int | _iSphereId | ) |
Move by mouse cursor.
_iSphereId | Sphere index |
Definition at line 63 of file K3dSphereWork.cpp.
References K3dPlaneWork::CalcPlane(), K3dSafePointer< _T >::Get(), K3dCameraData::GetActiveCamId(), K3dRayData::GetAimRayId(), K3dGameData::GetCameraObjSP(), K3dIntrLinePlane::GetIntrPoint(), K3dSceneData::GetMouse(), K3dCamera::GetPosition(), K3dSphere::GetPosition(), K3dGameData::GetRayObjSP(), K3dSphereMove::GetRotation(), K3dGameData::GetSphereObjSP(), K3dSceneData::GetVector3Work(), K3dVector3::GetX(), K3dVector3::GetY(), K3dVector3::GetZ(), K3D_ROT_AXIS_X, K3D_ROT_AXIS_Y, K3D_ROT_AXIS_Z, K3dIntrLinePlane::LinePlane(), m_bIsMouseRightUp, m_eRotAxis, m_pGameData, m_pIntersection, m_pPlane, m_pPlaneBuild, K3dMouse::MouseButtonLeft(), K3dMouse::MouseButtonRight(), K3dMouse::MouseWheelButtonDown(), K3dMouse::MouseWheelButtonUp(), K3dSphereMove::Move(), and K3dVector3Work::Normalize().
Referenced by K3dVM::MoveByMouse().
void K3dSphereWork::UpdateSpheres | ( | ) |
Sphere update.
Definition at line 163 of file K3dSphereWork.cpp.
References K3dSafePointer< _T >::Get(), K3dGameData::GetLineObjSP(), K3dSafePointer< _T >::GetNum(), K3dGameData::GetPlaneObjSP(), 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, K3dPlaneMove::SetMatrix(), and K3dLineMove::SetMatrix().
Referenced by K3dMngGeometry::UpdateMngGeometry().
void K3dSphereWork::LinkObject | ( | const int | _iSphereId, | |
const int | _iObjId, | |||
const int | _iObjType | |||
) |
Link object defined by obj type to the sphere.
Definition at line 209 of file K3dSphereWork.cpp.
References K3dSafePointer< _T >::Get(), K3dSphereObj::GetLinkObjMap(), K3dGameData::GetSphereObjSP(), and m_pGameData.
Referenced by K3dObjectWork::Link().
int K3dSphereWork::FindSphereId | ( | const char * | _strName | ) |
Find sphere index in global sphere data by sphere name.
Definition at line 223 of file K3dSphereWork.cpp.
References K3dSafePointer< _T >::Get(), K3dSafePointer< _T >::GetNum(), K3dGameData::GetSphereObjSP(), and m_pGameData.
Referenced by K3dObjectWork::FindObjectId().
int& K3dSphereWork::GetSphereId | ( | ) | [inline] |
K3dPlaneObj* K3dSphereWork::GetAimPlane | ( | ) | [inline] |
void K3dSphereWork::SetAimPlane | ( | K3dPlaneObj * | _pPlane | ) | [inline] |
K3dGameData* K3dSphereWork::m_pGameData [private] |
Global game data, data centered game system.
Reimplemented in K3dObjectBuild, K3dScene, K3dMngGeometry, K3dMngSystem, and K3dObjectWork.
Definition at line 56 of file K3dSphereWork.h.
Referenced by FindSphereId(), InitSphereWork(), K3dSphereWork(), LinkObject(), MoveByMouse(), and UpdateSpheres().
int K3dSphereWork::m_iSphereId [private] |
Sphere index.
Definition at line 57 of file K3dSphereWork.h.
Referenced by GetSphereId(), and K3dSphereWork().
ERotAxis K3dSphereWork::m_eRotAxis [private] |
Rotation axis for rotation by mouse.
Definition at line 58 of file K3dSphereWork.h.
Referenced by K3dSphereWork(), and MoveByMouse().
bool K3dSphereWork::m_bIsMouseRightUp [private] |
Is right mouse button up?
Definition at line 59 of file K3dSphereWork.h.
Referenced by K3dSphereWork(), and MoveByMouse().
K3dPlaneObj* K3dSphereWork::m_pPlane [private] |
Aiming plane for moving by mouse function.
Definition at line 60 of file K3dSphereWork.h.
Referenced by GetAimPlane(), InitSphereWork(), K3dSphereWork(), MoveByMouse(), and SetAimPlane().
K3dIntersection* K3dSphereWork::m_pIntersection [private] |
Pointer to intersection calculation.
Reimplemented in K3dObjectWork.
Definition at line 61 of file K3dSphereWork.h.
Referenced by K3dSphereWork(), and MoveByMouse().
K3dPlaneBuild* K3dSphereWork::m_pPlaneBuild [private] |
Pointer to plane builder.
Definition at line 62 of file K3dSphereWork.h.
Referenced by InitSphereWork(), K3dSphereWork(), and MoveByMouse().