Krig Game Engine
Functions | Variables
api_object.cpp File Reference

Krig Game Engine Lua Scripting API - Game Object. More...

Functions

void setup_interpolation (Vector4, float, Vector4, float)
 
void set_interpolation_value (float)
 
void suspend (float)
 
void set_model (string)
 
void set_texture (string)
 
void set_script (string)
 
void add_particle_system (GameObjectReference, int)
 
void orient_on_terrain (float, float, float)
 
void set_height_from_terrain (GameObjectReference, float)
 
GameObject load ()
 
void save ()
 

Variables

const luaL_reg krigObjectLib []
 

Detailed Description

Krig Game Engine Lua Scripting API - Game Object.

Game object API functionality.

Function Documentation

◆ add_particle_system()

void add_particle_system ( GameObjectReference  ,
int   
)

Add a particle system to the game object.

Parameters
int- number representing the particle system to load.
Returns
n/a

◆ load()

GameObject load ( )

Load properties for game object.

Returns
GameObject

◆ orient_on_terrain()

void orient_on_terrain ( float  ,
float  ,
float   
)

Rotate the game object such that it appears to be resting on the terrain. Additionally, the specified rotation will be used as the base rotation of the game object.

Parameters
xrotation around x axis
yrotation around y axis
zrotation around z axis
Returns
n/a

◆ save()

void save ( )

Save game object properties.

Returns
n/a

◆ set_height_from_terrain()

void set_height_from_terrain ( GameObjectReference  ,
float   
)

Determine the height of the terrain beneath the game object and set its height to match the terrain's height at this location. The offset is used to adjust the object's height along the y axis.

Parameters
float- height offset
Returns
n/a

◆ set_interpolation_value()

void set_interpolation_value ( float  )

Set current value of the interpolation variable.

Parameters
floatvalue.
Returns
n/a

◆ set_model()

void set_model ( string  )

Specify the model to render for the game object. file containing the model to load.

Returns
n/a

◆ set_script()

void set_script ( string  )

Set lua script for game object.

Parameters
stringlua script file name.
Returns
n/a

◆ set_texture()

void set_texture ( string  )

Specify the texture to render for the sprite. file containing the texture to load (in png format).

Returns
n/a

◆ setup_interpolation()

void setup_interpolation ( Vector4  ,
float  ,
Vector4  ,
float   
)

Set the end rotation (by axis) for the specified game object's interpolation.

Parameters
Vector4- start rotation.
float- start interpolation value.
Vector4- end rotation.
float- end interpolation value.
Returns
n/a

◆ suspend()

void suspend ( float  )

Suspend running the game object's script until the suspend time has elapsed.

Parameters
float
Returns
n/a

Variable Documentation

◆ krigObjectLib

const luaL_reg krigObjectLib[]
Initial value:
= {
{"add_particle_system", add_particle_system},
{"load", load},
{"orient_on_terrain", orient_on_terrain},
{"save", save},
{"set_height_from_terrain", set_height_from_terrain},
{"set_model", set_model},
{"set_texture", set_texture},
{"set_script", set_script},
{"setup_interpolation", setup_interpolation},
{"suspend", suspend},
{"update_interpolation_value", update_interpolation_value},
{NULL, NULL}
}
void set_model(string)
void suspend(float)
void add_particle_system(GameObjectReference, int)
void save()
void setup_interpolation(Vector4, float, Vector4, float)
void set_script(string)
void orient_on_terrain(float, float, float)
GameObject load()
void set_texture(string)
void set_height_from_terrain(GameObjectReference, float)