K3dVM.cpp File Reference


Functions

void Engine_Delete ()
void Engine_Init ()
void Engine_Update ()
int K3d_AddVertex (const float _x, const float _y, const float _z, const char _r, const char _g, const char _b, const int _size)
bool K3d_ButtonIsPressed (const int _iButtonId)
bool K3d_CheckKeyboardKey (const char *_strKey)
void K3d_Exit ()
float float float float float
float 
K3d_GetAimRay ()
float float float K3d_GetCamDir (const int _iId)
float float float K3d_GetCamPos (const int _iId)
float K3d_GetDistance (const int _iObjId0, const int _iObjId1, const int _iObjType0, const int _iObjType1)
int K3d_GetGuiObject (const char *_strObjName, const int _iObjType)
bool float float float K3d_GetIntersection (const int _iObjId0, const int _iObjId1, const int _iObjType0, const int _iObjType1, const bool _bGetIntrPoint)
bool K3d_GetIntersection (const int _iObjId0, const int _iObjId1, const int _iObjType0, const int _iObjType1)
int K3d_GetObject (const char *_strObjName, const int _iObjType)
float float float float float
float 
K3d_GetRayOrigDir (const int _iRayId)
float float float K3d_GetSpherePos (const int _iId)
void K3d_Hide (const int _iObjId, const int _iObjType, const bool _bHide)
void K3d_HideGui (const int _iObjId, const int _iObjType)
void K3d_IncludeScript (const char *_strFileName)
bool K3d_IsMouseLeft ()
bool K3d_IsMouseLeftUp ()
bool K3d_IsMouseRight ()
bool K3d_IsMouseRightUp ()
void K3d_Link (const int _iObjId0, const int _iObjId1, const int _iObjType0, const int _iObjType1)
void K3d_LoadMap (const char *_strFilename)
bool K3d_LoadMapFromListBox (const int _iListBoxId, const char *_strPath)
void K3d_LoadNewScript (const char *_strFileName)
void K3d_MoveByMouse (const int _iSphereId)
void K3d_Print (const char *_str)
void K3d_PrintValue (const char *_strComment, const float _fValue)
void K3d_SetColor (const int _iObjId, const int _iObjType, const char _r, const char _g, const char _b)
void K3d_SetLine (const int _iLineId, const float _origx, const float _origy, const float _origz, const float _dirx, const float _diry, const float _dirz)
void K3d_SetRay (const int _iRayId, const float _origx, const float _origy, const float _origz, const float _dirx, const float _diry, const float _dirz)
void K3d_SetVertexPos (const int _iVertexId, const float _x, const float _y, const float _z)
void K3d_ShowFileListBox (const int _iListModel, const char *_strPath)
void K3d_ShowGui (const int _iObjId, const int _iObjType)
bool K3d_Wait (const int _iMsec)

Detailed Description

K3dEngine script

K3dEngine 1.0 - OpenGL Game Engine http://sourceforge.net/projects/kengine/

07.08.10 - First version


Function Documentation

void Engine_Delete (  ) 

Delete function called from K3dEngine during delete scene.

void Engine_Init (  ) 

Init function called from K3dEngine during initialization.

void Engine_Update (  ) 

Update function called from K3dEngine during update scene.

int K3d_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.

Parameters:
_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
Return values:
int Vertex index. If return -1, then doesn`t exist current vertex

bool K3d_ButtonIsPressed ( const int  _iButtonId  ) 

Is button pressed ?

Parameters:
_iButtonId Button index
Return values:
bool True if button pressed

bool K3d_CheckKeyboardKey ( const char *  _strKey  ) 

Check if pressed keyboard key.

Parameters:
_strKey Keyboard key
Return values:
bool True if key pressed

void K3d_Exit (  ) 

Call exit engine.

float float float float float float K3d_GetAimRay (  ) 

Get aiming ray.

Return values:
float Ray origin X
float Ray origin Y
float Ray origin Z
float Ray direction X
float Ray direction Y
float Ray direction Z

float float float K3d_GetCamDir ( const int  _iId  ) 

Get camera direction from game data.

Parameters:
_iId Camera index
Return values:
float Camera direction X
float Camera direction Y
float Camera direction Z

float float float K3d_GetCamPos ( const int  _iId  ) 

Get camera position from game data.

Parameters:
_iId Camera index
Return values:
float Camera position X
float Camera position Y
float Camera position Z

float K3d_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

int K3d_GetGuiObject ( const char *  _strObjName,
const int  _iObjType 
)

Get gui object index from game data.

Parameters:
_strObjName Object name
_iObjType Object type id
Return values:
int Object index. If return -1, then doesn`t exist current object or object type

bool float float float K3d_GetIntersection ( const int  _iObjId0,
const int  _iObjId1,
const int  _iObjType0,
const int  _iObjType1,
const bool  _bGetIntrPoint 
)

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
_bGetIntrPoint Get intersection point ?
Return values:
bool True if Obj0 intersect Obj1
float Intersection point X
float Intersection point Y
float Intersection point Z

bool K3d_GetIntersection ( const int  _iObjId0,
const int  _iObjId1,
const int  _iObjType0,
const int  _iObjType1 
)

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:
bool True if Obj0 intersect Obj1

int K3d_GetObject ( const char *  _strObjName,
const int  _iObjType 
)

Get object index from game data.

Parameters:
_strObjName Object name
_iObjType Object type id
Return values:
int Object index. If return -1, then doesn`t exist current object or object type

float float float float float float K3d_GetRayOrigDir ( const int  _iRayId  ) 

Get ray origin and direction.

Return values:
_iRayId Ray index
float Ray origin X
float Ray origin Y
float Ray origin Z
float Ray direction X
float Ray direction Y
float Ray direction Z

float float float K3d_GetSpherePos ( const int  _iId  ) 

Get sphere position.

Parameters:
_iId Sphere index
Return values:
flaot Sphere position X
flaot Sphere position Y
flaot Sphere position Z

void K3d_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

void K3d_HideGui ( const int  _iObjId,
const int  _iObjType 
)

Hide gui object.

Parameters:
_iObjId Object index
_iObjType Object type id

void K3d_IncludeScript ( const char *  _strFileName  ) 

Include other script.

Parameters:
_strFileName Other script path and filename

bool K3d_IsMouseLeft (  ) 

Check if left mouse button is down.

bool K3d_IsMouseLeftUp (  ) 

Check if left mouse button is up.

bool K3d_IsMouseRight (  ) 

Check if right mouse button is down.

bool K3d_IsMouseRightUp (  ) 

Check if right mouse button is up.

void K3d_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

void K3d_LoadMap ( const char *  _strFilename  ) 

Load map file.

Parameters:
_strFilename Map path and filename string

bool K3d_LoadMapFromListBox ( const int  _iListBoxId,
const char *  _strPath 
)

Load selected map from list box.

Parameters:
_iListBoxId List box index
_strPath File path
Return values:
bool True if map is correctly loaded

void K3d_LoadNewScript ( const char *  _strFileName  ) 

Load new script and delete current script.

Parameters:
_strFileName New script filename

void K3d_MoveByMouse ( const int  _iSphereId  ) 

Move with sphere by mouse cursor.

void K3d_Print ( const char *  _str  ) 

Print string to the screen.

Parameters:
_str String printed to the screen

void K3d_PrintValue ( const char *  _strComment,
const float  _fValue 
)

Print string comment and float value to the screen.

Parameters:
_strComment Value comments
_fValue Value

void K3d_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

void K3d_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.

Parameters:
_iLineId 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

void K3d_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.

Parameters:
_iRayId 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

void K3d_SetVertexPos ( const int  _iVertexId,
const float  _x,
const float  _y,
const float  _z 
)

Set vertex position.

Parameters:
_iVertexId Current vertex index
_x Set vertex position x
_y Set vertex position y
_z Set vertex position z

void K3d_ShowFileListBox ( const int  _iListModel,
const char *  _strPath 
)

Show list box with files.

Parameters:
_iListModel List model index
_strPath File path

void K3d_ShowGui ( const int  _iObjId,
const int  _iObjType 
)

Show gui object.

Parameters:
_iObjId Object index
_iObjType Object type id

bool K3d_Wait ( const int  _iMsec  ) 

Wait some milliseconds.

Parameters:
_iMsec Waiting time in milliseconds
Return values:
bool True if time delay finished


Generated on Fri Aug 10 13:11:39 2007 for K3dScript by  doxygen 1.5.0