#include <K3dVM.h>
Public Member Functions | |
K3dVM (K3dGameData *_pGameData, K3dScene *_pScene) | |
K3dVM () | |
~K3dVM () | |
void | RegisterFunctions () |
Register script functions. | |
void | LoadScript (K3dString _strFilename) |
Load script. | |
void | Engine_Init () |
Call script Lua function Engine_Init. | |
void | Engine_Update () |
Call script Lua function Engine_Update. | |
void | Engine_Delete () |
Call script Lua function Engine_Delete. | |
K3dLua * | GetLua () |
Private Member Functions | |
void | LoadMap (K3dString &_strFilename) |
Load map file. | |
void | Print (const char *_str) |
Print string to the screen. | |
void | PrintValue (const char *_strComment, const float _fValue) |
Print string comment and float value to the screen. | |
bool | IsMouseLeft () |
Check if mouse left button is down. | |
bool | IsMouseRight () |
Check if mouse right button is down. | |
bool | IsMouseLeftUp () |
Check if mouse left button is up. | |
bool | IsMouseRightUp () |
Check if mouse right button is up. | |
bool | Wait (const int _iMsec) |
Wait some milliseconds. | |
void | IncludeScript (const char *_strFileName) |
Include other script. | |
bool | CheckKeyboardKey (const char *_strKey) |
Check if pressed keyboard key. | |
void | LoadNewScript (const char *_strFileName) |
Load new script and delete current script. | |
void | Exit () |
Call exit engine. | |
int | AddVertex (const float _x, const float _y, const float _z, const char _r, const char _g, const char _b, const int _size) |
Add vertex to the global game data. | |
K3dRay * | GetAimRay () |
Get aiming ray. | |
void | GetCamPos (const int _iId, K3dVector3 &_rkCamPos) |
Get camera position from game data. | |
void | GetCamDir (const int _iId, K3dVector3 &_rkCamDir) |
Get camera direction from game data. | |
int | GetObject (const char *_strObjName, const int _iObjType) |
Get object index from game data. | |
K3dRayObj * | GetRayOrigDir (const int _iRayId) |
Get ray origin and direction. | |
void | Hide (const int _iObjId, const int _iObjType, const bool _bHide) |
Hide or unhide current object. | |
void | SetLine (const int _iLineId, const float _origx, const float _origy, const float _origz, const float _dirx, const float _diry, const float _dirz) |
Set line origin and direction. | |
void | SetColor (const int _iObjId, const int _iObjType, const char _r, const char _g, const char _b) |
Set object color. | |
void | SetRay (const int _iRayId, const float _origx, const float _origy, const float _origz, const float _dirx, const float _diry, const float _dirz) |
Set ray origin and direction. | |
void | SetVertexPos (const int _iVertexId, const float _x, const float _y, const float _z) |
Set vertex position. | |
void | MoveByMouse (const int _iSphereId) |
Move with sphere by mouse cursor position. | |
void | GetSpherePos (const int _iId, K3dVector3 &_rkPos) |
Get sphere position. | |
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. | |
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. | |
float | GetDistance (const int _iObjId0, const int _iObjId1, const int _iObjType0, const int _iObjType1) |
Calculate distance between Obj0 and Obj1 by object type. | |
int | GetGuiObject (const char *_strObjName, const int _iObjType) |
Gui functions. | |
bool | ButtonIsPressed (const int _iButtonId) |
Is button pressed ? | |
void | HideGui (const int _iObjId, const int _iObjType) |
Hide gui object. | |
void | ShowGui (const int _iObjId, const int _iObjType) |
Show gui object. | |
void | ShowFileListBox (const int _iListModel, const char *_strPath) |
Show list box with files. | |
bool | LoadMapFromListBox (const int _iListBoxId, const char *_strPath) |
Load selected test in main menu list box. | |
Static Private Member Functions | |
static int | K3d_LoadMap (lua_State *_pState) |
System functions. | |
static int | K3d_Print (lua_State *_pState) |
Script function calling Print function. | |
static int | K3d_PrintValue (lua_State *_pState) |
Script function calling PrintValue function. | |
static int | K3d_IsMouseLeft (lua_State *_pState) |
Script function calling IsMouseLeft(). | |
static int | K3d_IsMouseRight (lua_State *_pState) |
Script function calling IsMouseRight(). | |
static int | K3d_IsMouseLeftUp (lua_State *_pState) |
Script function calling IsMouseLeftUp(). | |
static int | K3d_IsMouseRightUp (lua_State *_pState) |
Script function calling IsMouseRightUp(). | |
static int | K3d_Wait (lua_State *_pState) |
Script function calling Wait() function. | |
static int | K3d_IncludeScript (lua_State *_pState) |
Script function calling IncludeScript() function. | |
static int | K3d_CheckKeyboardKey (lua_State *_pState) |
static int | K3d_LoadNewScript (lua_State *_pState) |
static int | K3d_Exit (lua_State *_pState) |
static int | K3d_AddVertex (lua_State *_pState) |
Geometry functions. | |
static int | K3d_GetAimRay (lua_State *_pState) |
Script function calling GetAimRay function. | |
static int | K3d_GetCamPos (lua_State *_pState) |
Script function calling GetCamPos function. | |
static int | K3d_GetCamDir (lua_State *_pState) |
Script function calling GetCamDir function. | |
static int | K3d_GetObject (lua_State *_pState) |
static int | K3d_GetRayOrigDir (lua_State *_pState) |
Script function calling GetRayOrigDir function. | |
static int | K3d_Hide (lua_State *_pState) |
Script function calling Hide function. | |
static int | K3d_SetLine (lua_State *_pState) |
Script function calling SetLine function. | |
static int | K3d_SetColor (lua_State *_pState) |
static int | K3d_SetRay (lua_State *_pState) |
Script function calling SetRay function. | |
static int | K3d_SetVertexPos (lua_State *_pState) |
Script function calling SetVertexPos function. | |
static int | K3d_MoveByMouse (lua_State *_pState) |
Script function calling MoveByMouse(). | |
static int | K3d_GetSpherePos (lua_State *_pState) |
Script function calling GetSpherePos(). | |
static int | K3d_Link (lua_State *_pState) |
Script function calling Link() function. | |
static int | K3d_GetIntersection (lua_State *_pState) |
Math functions. | |
static int | K3d_GetDistance (lua_State *_pState) |
Script function calling GetDistance(). | |
static int | K3d_GetGuiObject (lua_State *_pState) |
Script function calling GetGuiObject() function. | |
static int | K3d_ButtonIsPressed (lua_State *_pState) |
Script function calling ButtonIsPressed() function. | |
static int | K3d_HideGui (lua_State *_pState) |
Script function calling HideGui() function. | |
static int | K3d_ShowGui (lua_State *_pState) |
Script function calling ShowGui() function. | |
static int | K3d_ShowFileListBox (lua_State *_pState) |
Script function calling ShowFileListBox() function. | |
static int | K3d_LoadMapFromListBox (lua_State *_pState) |
Load selected map from list box. | |
Static Private Attributes | |
static K3dLua * | ms_pLua |
static K3dGameData * | ms_pGameData |
Global game data, data centered game system. | |
static K3dScene * | ms_pScene |
static K3dCameraBuild * | ms_pCameraBuild |
Pointer to camera build object for find camera index from camera name. | |
static void * | ms_pObject |
Pointer to some void. |
Definition at line 41 of file K3dVM.h.
K3dVM::K3dVM | ( | K3dGameData * | _pGameData, | |
K3dScene * | _pScene | |||
) |
Definition at line 41 of file K3dVM.cpp.
References K3dSceneData::GetLua(), ms_pCameraBuild, ms_pGameData, ms_pLua, ms_pScene, RegisterFunctions(), and K3dSceneData::SetVM().
K3dVM::~K3dVM | ( | ) |
int K3dVM::K3d_LoadMap | ( | lua_State * | _pState | ) | [static, private] |
System functions.
Definition at line 170 of file K3dVM.cpp.
References K3dLua::GetLuaState(), LoadMap(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
void K3dVM::LoadMap | ( | K3dString & | _strFilename | ) | [private] |
Load map file.
_strFilename | map path and filename string |
Definition at line 162 of file K3dVM.cpp.
References K3dString::GetString(), K3dScene::Load(), and ms_pScene.
Referenced by K3d_LoadMap().
int K3dVM::K3d_Print | ( | lua_State * | _pState | ) | [static, private] |
Script function calling Print function.
Definition at line 690 of file K3dVM.cpp.
References ms_pObject, and Print().
Referenced by RegisterFunctions().
void K3dVM::Print | ( | const char * | _str | ) | [private] |
Print string to the screen.
_str | String printed to the screen |
Definition at line 684 of file K3dVM.cpp.
References K3dFontBmp::DrawValue(), and ms_pScene.
Referenced by K3d_Print().
int K3dVM::K3d_PrintValue | ( | lua_State * | _pState | ) | [static, private] |
Script function calling PrintValue function.
Definition at line 669 of file K3dVM.cpp.
References ms_pObject, and PrintValue().
Referenced by RegisterFunctions().
void K3dVM::PrintValue | ( | const char * | _strComment, | |
const float | _fValue | |||
) | [private] |
Print string comment and float value to the screen.
_strComment | Value comments | |
_fValue | Value |
Definition at line 663 of file K3dVM.cpp.
References K3dFontBmp::DrawValue(), and ms_pScene.
Referenced by K3d_PrintValue().
int K3dVM::K3d_IsMouseLeft | ( | lua_State * | _pState | ) | [static, private] |
Script function calling IsMouseLeft().
Definition at line 747 of file K3dVM.cpp.
References IsMouseLeft(), K3dLua::LuaCheckStack(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
bool K3dVM::IsMouseLeft | ( | ) | [private] |
Check if mouse left button is down.
Definition at line 740 of file K3dVM.cpp.
References K3dSceneData::GetMouse(), K3dMouse::MouseButtonLeft(), and ms_pGameData.
Referenced by K3d_IsMouseLeft().
int K3dVM::K3d_IsMouseRight | ( | lua_State * | _pState | ) | [static, private] |
Script function calling IsMouseRight().
Definition at line 774 of file K3dVM.cpp.
References IsMouseRight(), K3dLua::LuaCheckStack(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
bool K3dVM::IsMouseRight | ( | ) | [private] |
Check if mouse right button is down.
Definition at line 767 of file K3dVM.cpp.
References K3dSceneData::GetMouse(), K3dMouse::MouseButtonRight(), and ms_pGameData.
Referenced by K3d_IsMouseRight().
int K3dVM::K3d_IsMouseLeftUp | ( | lua_State * | _pState | ) | [static, private] |
Script function calling IsMouseLeftUp().
Definition at line 803 of file K3dVM.cpp.
References IsMouseLeftUp(), K3dLua::LuaCheckStack(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
bool K3dVM::IsMouseLeftUp | ( | ) | [private] |
Check if mouse left button is up.
Definition at line 796 of file K3dVM.cpp.
References K3dSceneData::GetMouse(), K3dMouse::MouseButtonLeft(), and ms_pGameData.
Referenced by K3d_IsMouseLeftUp().
int K3dVM::K3d_IsMouseRightUp | ( | lua_State * | _pState | ) | [static, private] |
Script function calling IsMouseRightUp().
Definition at line 830 of file K3dVM.cpp.
References IsMouseRightUp(), K3dLua::LuaCheckStack(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
bool K3dVM::IsMouseRightUp | ( | ) | [private] |
Check if mouse right button is up.
Definition at line 823 of file K3dVM.cpp.
References K3dSceneData::GetMouse(), K3dMouse::MouseButtonRight(), and ms_pGameData.
Referenced by K3d_IsMouseRightUp().
int K3dVM::K3d_Wait | ( | lua_State * | _pState | ) | [static, private] |
Script function calling Wait() function.
Definition at line 912 of file K3dVM.cpp.
References K3dLua::LuaCheckStack(), ms_pLua, ms_pObject, and Wait().
Referenced by RegisterFunctions().
bool K3dVM::Wait | ( | const int | _iMsec | ) | [private] |
Wait some milliseconds.
_iMsec | Waiting time in milliseconds |
bool | True if time delay finished |
Definition at line 906 of file K3dVM.cpp.
References K3dSceneData::GetTimer(), ms_pGameData, and K3dTimer::Wait().
Referenced by K3d_Wait().
int K3dVM::K3d_IncludeScript | ( | lua_State * | _pState | ) | [static, private] |
Script function calling IncludeScript() function.
Definition at line 941 of file K3dVM.cpp.
References IncludeScript(), and ms_pObject.
Referenced by RegisterFunctions().
void K3dVM::IncludeScript | ( | const char * | _strFileName | ) | [private] |
Include other script.
Definition at line 934 of file K3dVM.cpp.
References K3dSystemData::GetSysHome(), K3D_STR_SHARE_PATH, LoadScript(), and ms_pGameData.
Referenced by K3d_IncludeScript().
bool K3dVM::CheckKeyboardKey | ( | const char * | _strKey | ) | [private] |
Check if pressed keyboard key.
_strKey | Keyboard key |
bool | True if key pressed |
Definition at line 1136 of file K3dVM.cpp.
References K3dKeyboard::GetKeyEsc(), K3dSceneData::GetKeyMap(), and ms_pGameData.
Referenced by K3d_CheckKeyboardKey().
int K3dVM::K3d_CheckKeyboardKey | ( | lua_State * | _pState | ) | [static, private] |
Definition at line 1147 of file K3dVM.cpp.
References CheckKeyboardKey(), and ms_pObject.
Referenced by RegisterFunctions().
void K3dVM::LoadNewScript | ( | const char * | _strFileName | ) | [private] |
Load new script and delete current script.
_strFileName | New script filename |
Definition at line 1163 of file K3dVM.cpp.
References K3dScene::LoadNewScript(), and ms_pScene.
Referenced by K3d_LoadNewScript().
int K3dVM::K3d_LoadNewScript | ( | lua_State * | _pState | ) | [static, private] |
Definition at line 1167 of file K3dVM.cpp.
References LoadNewScript(), and ms_pObject.
Referenced by RegisterFunctions().
void K3dVM::Exit | ( | ) | [private] |
Call exit engine.
Definition at line 1180 of file K3dVM.cpp.
References K3dScene::GetExit(), and ms_pScene.
Referenced by K3d_Exit().
int K3dVM::K3d_Exit | ( | lua_State * | _pState | ) | [static, private] |
Definition at line 1185 of file K3dVM.cpp.
References Exit(), and ms_pObject.
Referenced by RegisterFunctions().
int K3dVM::K3d_AddVertex | ( | lua_State * | _pState | ) | [static, private] |
Geometry functions.
Definition at line 477 of file K3dVM.cpp.
References AddVertex(), K3dLua::LuaCheckStack(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
int K3dVM::AddVertex | ( | const float | _x, | |
const float | _y, | |||
const float | _z, | |||
const char | _r, | |||
const char | _g, | |||
const char | _b, | |||
const int | _size | |||
) | [private] |
Add vertex to the global game data.
_x | Vertex position x | |
_y | Vertex position y | |
_z | Vertex position z | |
_r | Vertex color r | |
_g | Vertex color g | |
_b | Vertex color b | |
_size | Vertex size |
int | Vertex index. If return -1, then doesn`t exist current vertex |
Definition at line 462 of file K3dVM.cpp.
References K3dVertexBuild::CreateNewVertexObj(), K3dColor4::GetB(), K3dVertex::GetColor(), K3dColor4::GetG(), K3dVertexObj::GetId(), K3dVertex::GetPosition(), K3dColor4::GetR(), K3dVertex::GetSize(), K3dSceneData::GetVertexBuild(), K3dVector3::GetX(), K3dVector3::GetY(), K3dVector3::GetZ(), and ms_pGameData.
Referenced by K3d_AddVertex().
K3dRay * K3dVM::GetAimRay | ( | ) | [private] |
Get aiming ray.
_rkRay | Returns aiming ray |
Definition at line 291 of file K3dVM.cpp.
References K3dSafePointer< _T >::Get(), K3dRayData::GetAimRayId(), K3dGameData::GetRayObjSP(), and ms_pGameData.
Referenced by K3d_GetAimRay().
int K3dVM::K3d_GetAimRay | ( | lua_State * | _pState | ) | [static, private] |
Script function calling GetAimRay function.
Definition at line 297 of file K3dVM.cpp.
References GetAimRay(), K3dLua::LuaCheckStack(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
int K3dVM::K3d_GetCamPos | ( | lua_State * | _pState | ) | [static, private] |
Script function calling GetCamPos function.
Definition at line 230 of file K3dVM.cpp.
References GetCamPos(), K3dLua::LuaCheckStack(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
void K3dVM::GetCamPos | ( | const int | _iId, | |
K3dVector3 & | _rkCamPos | |||
) | [private] |
Get camera position from game data.
_iId | Camera index |
_rkCamPos | Camera position |
Definition at line 224 of file K3dVM.cpp.
References K3dSafePointer< _T >::Get(), K3dGameData::GetCameraObjSP(), K3dCamera::GetCameraPos(), and ms_pGameData.
Referenced by K3d_GetCamPos().
int K3dVM::K3d_GetCamDir | ( | lua_State * | _pState | ) | [static, private] |
Script function calling GetCamDir function.
Definition at line 264 of file K3dVM.cpp.
References GetCamDir(), K3dLua::LuaCheckStack(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
void K3dVM::GetCamDir | ( | const int | _iId, | |
K3dVector3 & | _rkCamDir | |||
) | [private] |
Get camera direction from game data.
_iId | Camera index |
_rkCamDir | Camera direction |
Definition at line 258 of file K3dVM.cpp.
References K3dSafePointer< _T >::Get(), K3dGameData::GetCameraObjSP(), K3dCamera::GetView(), and ms_pGameData.
Referenced by K3d_GetCamDir().
int K3dVM::K3d_GetObject | ( | lua_State * | _pState | ) | [static, private] |
Definition at line 198 of file K3dVM.cpp.
References GetObject(), K3dLua::LuaCheckStack(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
int K3dVM::GetObject | ( | const char * | _strObjName, | |
const int | _iObjType | |||
) | [private] |
Get object index from game data.
_strObjName | Object name | |
_iObjType | Object type id |
int | Object index. If return -1, then doesn`t exist current object or object type |
Definition at line 191 of file K3dVM.cpp.
References K3dObjectWork::FindObjectId(), and ms_pScene.
Referenced by K3d_GetObject().
int K3dVM::K3d_GetRayOrigDir | ( | lua_State * | _pState | ) | [static, private] |
Script function calling GetRayOrigDir function.
Definition at line 339 of file K3dVM.cpp.
References GetRayOrigDir(), K3dLua::LuaCheckStack(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
K3dRayObj * K3dVM::GetRayOrigDir | ( | const int | _iRayId | ) | [private] |
Get ray origin and direction.
_rkRay | Returns aiming ray |
Definition at line 333 of file K3dVM.cpp.
References K3dSafePointer< _T >::Get(), K3dGameData::GetRayObjSP(), and ms_pGameData.
Referenced by K3d_GetRayOrigDir().
int K3dVM::K3d_Hide | ( | lua_State * | _pState | ) | [static, private] |
Script function calling Hide function.
Definition at line 646 of file K3dVM.cpp.
References Hide(), and ms_pObject.
Referenced by RegisterFunctions().
void K3dVM::Hide | ( | const int | _iObjId, | |
const int | _iObjType, | |||
const bool | _bHide | |||
) | [private] |
Hide or unhide current object.
_iObjId | Current object index | |
_iObjType | Object type | |
_bHide | If true then hide current object |
Definition at line 640 of file K3dVM.cpp.
References K3dObjectWork::Hide(), and ms_pScene.
Referenced by K3d_Hide().
int K3dVM::K3d_SetLine | ( | lua_State * | _pState | ) | [static, private] |
Script function calling SetLine function.
Definition at line 618 of file K3dVM.cpp.
References ms_pObject, and SetLine().
Referenced by RegisterFunctions().
void K3dVM::SetLine | ( | const int | _iLineId, | |
const float | _origx, | |||
const float | _origy, | |||
const float | _origz, | |||
const float | _dirx, | |||
const float | _diry, | |||
const float | _dirz | |||
) | [private] |
Set line origin and direction.
_iLineId | Current line index | |
_origx | Set origin x | |
_origy | Set origin y | |
_origz | Set origin z | |
_dirx | Set direction x | |
_diry | Set direction y | |
_dirz | Set direction z |
Definition at line 606 of file K3dVM.cpp.
References K3dSafePointer< _T >::Get(), K3dGameData::GetLineObjSP(), K3dLineMove::GetRelDirection(), K3dLineMove::GetRelOrigin(), K3dVector3::GetX(), K3dVector3::GetY(), K3dVector3::GetZ(), and ms_pGameData.
Referenced by K3d_SetLine().
int K3dVM::K3d_SetColor | ( | lua_State * | _pState | ) | [static, private] |
Definition at line 544 of file K3dVM.cpp.
References ms_pObject, and SetColor().
Referenced by RegisterFunctions().
void K3dVM::SetColor | ( | const int | _iObjId, | |
const int | _iObjType, | |||
const char | _r, | |||
const char | _g, | |||
const char | _b | |||
) | [private] |
Set object color.
_iObjId | Object index | |
_iObjType | Object type | |
_r | Red color | |
_g | Green color | |
_b | Blue color |
Definition at line 539 of file K3dVM.cpp.
References ms_pScene, and K3dObjectWork::SetColor().
Referenced by K3d_SetColor().
int K3dVM::K3d_SetRay | ( | lua_State * | _pState | ) | [static, private] |
Script function calling SetRay function.
Definition at line 580 of file K3dVM.cpp.
References ms_pObject, and SetRay().
Referenced by RegisterFunctions().
void K3dVM::SetRay | ( | const int | _iRayId, | |
const float | _origx, | |||
const float | _origy, | |||
const float | _origz, | |||
const float | _dirx, | |||
const float | _diry, | |||
const float | _dirz | |||
) | [private] |
Set ray origin and direction.
_iRayId | Current ray index | |
_origx | Set origin x | |
_origy | Set origin y | |
_origz | Set origin z | |
_dirx | Set direction x | |
_diry | Set direction y | |
_dirz | Set direction z |
Definition at line 568 of file K3dVM.cpp.
References K3dSafePointer< _T >::Get(), K3dRay::GetDirection(), K3dRay::GetOrigin(), K3dGameData::GetRayObjSP(), K3dVector3::GetX(), K3dVector3::GetY(), K3dVector3::GetZ(), and ms_pGameData.
Referenced by K3d_SetRay().
int K3dVM::K3d_SetVertexPos | ( | lua_State * | _pState | ) | [static, private] |
Script function calling SetVertexPos function.
Definition at line 519 of file K3dVM.cpp.
References ms_pObject, and SetVertexPos().
Referenced by RegisterFunctions().
void K3dVM::SetVertexPos | ( | const int | _iVertexId, | |
const float | _x, | |||
const float | _y, | |||
const float | _z | |||
) | [private] |
Set vertex position.
_iVertexId | Current vertex index | |
_x | Set vertex position x | |
_y | Set vertex position y | |
_z | Set vertex position z |
Definition at line 510 of file K3dVM.cpp.
References K3dSafePointer< _T >::Get(), K3dVertex::GetPosition(), K3dGameData::GetVertexObjSP(), K3dVector3::GetX(), K3dVector3::GetY(), K3dVector3::GetZ(), and ms_pGameData.
Referenced by K3d_SetVertexPos().
int K3dVM::K3d_MoveByMouse | ( | lua_State * | _pState | ) | [static, private] |
Script function calling MoveByMouse().
Definition at line 857 of file K3dVM.cpp.
References MoveByMouse(), and ms_pObject.
Referenced by RegisterFunctions().
void K3dVM::MoveByMouse | ( | const int | _iSphereId | ) | [private] |
Move with sphere by mouse cursor position.
Definition at line 851 of file K3dVM.cpp.
References K3dSphereWork::MoveByMouse(), and ms_pScene.
Referenced by K3d_MoveByMouse().
int K3dVM::K3d_GetSpherePos | ( | lua_State * | _pState | ) | [static, private] |
Script function calling GetSpherePos().
Definition at line 878 of file K3dVM.cpp.
References GetSpherePos(), K3dLua::LuaCheckStack(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
void K3dVM::GetSpherePos | ( | const int | _iId, | |
K3dVector3 & | _rkPos | |||
) | [private] |
Get sphere position.
_iId | Sphere index | |
_rkPos | Sphere position |
_rkPos | Sphere position |
Definition at line 872 of file K3dVM.cpp.
References K3dSafePointer< _T >::Get(), K3dSphere::GetPosition(), K3dGameData::GetSphereObjSP(), and ms_pGameData.
Referenced by K3d_GetSpherePos().
int K3dVM::K3d_Link | ( | lua_State * | _pState | ) | [static, private] |
Script function calling Link() function.
Definition at line 964 of file K3dVM.cpp.
References Link(), and ms_pObject.
Referenced by RegisterFunctions().
void K3dVM::Link | ( | const int | _iObjId0, | |
const int | _iObjId1, | |||
const int | _iObjType0, | |||
const int | _iObjType1 | |||
) | [private] |
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 958 of file K3dVM.cpp.
References K3dObjectWork::Link(), and ms_pScene.
Referenced by K3d_Link().
int K3dVM::K3d_GetIntersection | ( | lua_State * | _pState | ) | [static, private] |
Math functions.
Definition at line 400 of file K3dVM.cpp.
References GetIntersection(), K3dLua::LuaCheckStack(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
bool K3dVM::GetIntersection | ( | const int | _iObjId0, | |
const int | _iObjId1, | |||
const int | _iObjType0, | |||
const int | _iObjType1, | |||
K3dVector3 & | _rkInrPoint | |||
) | [private] |
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 394 of file K3dVM.cpp.
References K3dObjectWork::GetIntersection(), and ms_pScene.
Referenced by K3d_GetIntersection().
bool K3dVM::GetIntersection | ( | const int | _iObjId0, | |
const int | _iObjId1, | |||
const int | _iObjType0, | |||
const int | _iObjType1 | |||
) | [private] |
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 382 of file K3dVM.cpp.
References K3dObjectWork::GetIntersection(), and ms_pScene.
int K3dVM::K3d_GetDistance | ( | lua_State * | _pState | ) | [static, private] |
Script function calling GetDistance().
Definition at line 714 of file K3dVM.cpp.
References GetDistance(), K3dLua::LuaCheckStack(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
float K3dVM::GetDistance | ( | const int | _iObjId0, | |
const int | _iObjId1, | |||
const int | _iObjType0, | |||
const int | _iObjType1 | |||
) | [private] |
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 708 of file K3dVM.cpp.
References K3dObjectWork::GetDistance(), and ms_pScene.
Referenced by K3d_GetDistance().
int K3dVM::GetGuiObject | ( | const char * | _strObjName, | |
const int | _iObjType | |||
) | [private] |
Gui functions.
_strObjName | Object name | |
_iObjType | Object type id |
int | Object index. If return -1, then doesn`t exist current object or object type |
Definition at line 1014 of file K3dVM.cpp.
References K3dGui::FindGuiObjectId(), and ms_pScene.
Referenced by K3d_GetGuiObject().
int K3dVM::K3d_GetGuiObject | ( | lua_State * | _pState | ) | [static, private] |
Script function calling GetGuiObject() function.
Definition at line 1022 of file K3dVM.cpp.
References GetGuiObject(), K3dLua::LuaCheckStack(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
bool K3dVM::ButtonIsPressed | ( | const int | _iButtonId | ) | [private] |
Is button pressed ?
_iButtonId | Button index |
bool | True if button pressed |
Definition at line 982 of file K3dVM.cpp.
References K3dMenu::ButtonIsPressed(), and ms_pScene.
Referenced by K3d_ButtonIsPressed().
int K3dVM::K3d_ButtonIsPressed | ( | lua_State * | _pState | ) | [static, private] |
Script function calling ButtonIsPressed() function.
Definition at line 988 of file K3dVM.cpp.
References ButtonIsPressed(), K3dLua::LuaCheckStack(), ms_pLua, and ms_pObject.
Referenced by RegisterFunctions().
void K3dVM::HideGui | ( | const int | _iObjId, | |
const int | _iObjType | |||
) | [private] |
Hide gui object.
_iObjId | Object index | |
_iObjType | Object type id |
Definition at line 1048 of file K3dVM.cpp.
References K3dGui::HideGui(), and ms_pScene.
Referenced by K3d_HideGui().
int K3dVM::K3d_HideGui | ( | lua_State * | _pState | ) | [static, private] |
Script function calling HideGui() function.
Definition at line 1054 of file K3dVM.cpp.
References HideGui(), and ms_pObject.
Referenced by RegisterFunctions().
void K3dVM::ShowGui | ( | const int | _iObjId, | |
const int | _iObjType | |||
) | [private] |
Show gui object.
_iObjId | Object index | |
_iObjType | Object type id |
Definition at line 1070 of file K3dVM.cpp.
References ms_pScene, and K3dGui::ShowGui().
Referenced by K3d_ShowGui().
int K3dVM::K3d_ShowGui | ( | lua_State * | _pState | ) | [static, private] |
Script function calling ShowGui() function.
Definition at line 1076 of file K3dVM.cpp.
References ms_pObject, and ShowGui().
Referenced by RegisterFunctions().
void K3dVM::ShowFileListBox | ( | const int | _iListModel, | |
const char * | _strPath | |||
) | [private] |
Show list box with files.
_iListModel | List model index | |
_strPath | File path |
Definition at line 1092 of file K3dVM.cpp.
References ms_pScene, and K3dMenu::ShowFileListBox().
Referenced by K3d_ShowFileListBox().
int K3dVM::K3d_ShowFileListBox | ( | lua_State * | _pState | ) | [static, private] |
Script function calling ShowFileListBox() function.
Definition at line 1098 of file K3dVM.cpp.
References ms_pObject, and ShowFileListBox().
Referenced by RegisterFunctions().
bool K3dVM::LoadMapFromListBox | ( | const int | _iListBoxId, | |
const char * | _strPath | |||
) | [private] |
Load selected test in main menu list box.
Definition at line 1112 of file K3dVM.cpp.
References K3dMenu::LoadMapFromListBox(), and ms_pScene.
Referenced by K3d_LoadMapFromListBox().
int K3dVM::K3d_LoadMapFromListBox | ( | lua_State * | _pState | ) | [static, private] |
Load selected map from list box.
Definition at line 1118 of file K3dVM.cpp.
References LoadMapFromListBox(), and ms_pObject.
Referenced by RegisterFunctions().
void K3dVM::RegisterFunctions | ( | ) |
Register script functions.
Definition at line 63 of file K3dVM.cpp.
References K3d_AddVertex(), K3d_ButtonIsPressed(), K3d_CheckKeyboardKey(), K3d_Exit(), K3d_GetAimRay(), K3d_GetCamDir(), K3d_GetCamPos(), K3d_GetDistance(), K3d_GetGuiObject(), K3d_GetIntersection(), K3d_GetObject(), K3d_GetRayOrigDir(), K3d_GetSpherePos(), K3d_Hide(), K3d_HideGui(), K3d_IncludeScript(), K3d_IsMouseLeft(), K3d_IsMouseLeftUp(), K3d_IsMouseRight(), K3d_IsMouseRightUp(), K3d_Link(), K3d_LoadMap(), K3d_LoadMapFromListBox(), K3d_LoadNewScript(), K3d_MoveByMouse(), K3d_Print(), K3d_PrintValue(), K3d_SetColor(), K3d_SetLine(), K3d_SetRay(), K3d_SetVertexPos(), K3d_ShowFileListBox(), K3d_ShowGui(), K3d_Wait(), K3dLua::LuaRegister(), and ms_pLua.
Referenced by K3dVM(), and K3dScene::LoadNewScript().
void K3dVM::LoadScript | ( | K3dString | _strFilename | ) |
Load script.
_strFilename | Script file name |
Definition at line 104 of file K3dVM.cpp.
References K3dString::GetString(), K3dLua::LuaError(), K3dLua::LuaLoadFile(), K3dLua::LuaToString(), and ms_pLua.
Referenced by IncludeScript(), and K3dEngine::InitEngine().
void K3dVM::Engine_Init | ( | ) |
Call script Lua function Engine_Init.
Definition at line 115 of file K3dVM.cpp.
References K3dLua::GetLuaState(), K3dLua::LuaError(), K3dLua::LuaGetGlobal(), K3dLua::LuaPCall(), and ms_pLua.
Referenced by K3dEngine::InitEngine(), and K3dScene::LoadNewScript().
void K3dVM::Engine_Update | ( | ) |
Call script Lua function Engine_Update.
Definition at line 128 of file K3dVM.cpp.
References K3dLua::GetLuaState(), K3dLua::LuaError(), K3dLua::LuaGetGlobal(), K3dLua::LuaPCall(), and ms_pLua.
Referenced by K3dEngine::Start().
void K3dVM::Engine_Delete | ( | ) |
Call script Lua function Engine_Delete.
Definition at line 140 of file K3dVM.cpp.
References K3dLua::GetLuaState(), K3dLua::LuaError(), K3dLua::LuaGetGlobal(), K3dLua::LuaPCall(), and ms_pLua.
Referenced by K3dEngine::Destroy().
K3dLua* K3dVM::GetLua | ( | ) | [inline] |
Definition at line 139 of file K3dVM.h.
References ms_pLua.
Referenced by K3dScene::LoadNewScript().
K3dLua * K3dVM::ms_pLua [static, private] |
Definition at line 43 of file K3dVM.h.
Referenced by Engine_Delete(), Engine_Init(), Engine_Update(), GetLua(), K3d_AddVertex(), K3d_ButtonIsPressed(), K3d_GetAimRay(), K3d_GetCamDir(), K3d_GetCamPos(), K3d_GetDistance(), K3d_GetGuiObject(), K3d_GetIntersection(), K3d_GetObject(), K3d_GetRayOrigDir(), K3d_GetSpherePos(), K3d_IsMouseLeft(), K3d_IsMouseLeftUp(), K3d_IsMouseRight(), K3d_IsMouseRightUp(), K3d_LoadMap(), K3d_Wait(), K3dVM(), LoadScript(), and RegisterFunctions().
K3dGameData * K3dVM::ms_pGameData [static, private] |
Global game data, data centered game system.
Definition at line 44 of file K3dVM.h.
Referenced by AddVertex(), CheckKeyboardKey(), GetAimRay(), GetCamDir(), GetCamPos(), GetRayOrigDir(), GetSpherePos(), IncludeScript(), IsMouseLeft(), IsMouseLeftUp(), IsMouseRight(), IsMouseRightUp(), K3dVM(), SetLine(), SetRay(), SetVertexPos(), and Wait().
K3dScene * K3dVM::ms_pScene [static, private] |
Definition at line 45 of file K3dVM.h.
Referenced by ButtonIsPressed(), Exit(), GetDistance(), GetGuiObject(), GetIntersection(), GetObject(), Hide(), HideGui(), K3dVM(), Link(), LoadMap(), LoadMapFromListBox(), LoadNewScript(), MoveByMouse(), Print(), PrintValue(), SetColor(), ShowFileListBox(), and ShowGui().
K3dCameraBuild * K3dVM::ms_pCameraBuild [static, private] |
void * K3dVM::ms_pObject [static, private] |
Pointer to some void.
Definition at line 47 of file K3dVM.h.
Referenced by K3d_AddVertex(), K3d_ButtonIsPressed(), K3d_CheckKeyboardKey(), K3d_Exit(), K3d_GetAimRay(), K3d_GetCamDir(), K3d_GetCamPos(), K3d_GetDistance(), K3d_GetGuiObject(), K3d_GetIntersection(), K3d_GetObject(), K3d_GetRayOrigDir(), K3d_GetSpherePos(), K3d_Hide(), K3d_HideGui(), K3d_IncludeScript(), K3d_IsMouseLeft(), K3d_IsMouseLeftUp(), K3d_IsMouseRight(), K3d_IsMouseRightUp(), K3d_Link(), K3d_LoadMap(), K3d_LoadMapFromListBox(), K3d_LoadNewScript(), K3d_MoveByMouse(), K3d_Print(), K3d_PrintValue(), K3d_SetColor(), K3d_SetLine(), K3d_SetRay(), K3d_SetVertexPos(), K3d_ShowFileListBox(), K3d_ShowGui(), and K3d_Wait().