![]() |
LibGame
v0.4.0
The LG Game Engine - Copyright (C) 2024-2025 ETMSoftware
|
Functions | |
LG_Scene | lg_scene_new (int id, LG_Camera *cam1, LG_Light light1, Rec2Df landscape_rec, uint16_t grid_width) |
void | lg_scene_free (LG_Scene *scene) |
LG_SceneNode * | lg_scenenode_new_and_set (int id, LG_SceneNode *parent, const char *mesh_file, LG_LoadMesh_Flags flags, vec3_t transl, LG_Quat orientation, vec3_t scaling) |
=== Higher level scene/frame stuff === The starting point for scenes
LG_Scene lg_scene_new | ( | int | id, |
LG_Camera * | cam1, | ||
LG_Light | light1, | ||
Rec2Df | landscape_rec, | ||
uint16_t | grid_width | ||
) |
Create and init a new scene
LG_Scene is defined in lg_scene_graph.h
Generated nodes:
id | Scene's id, set to -1 on error |
cam1 | A pointer to a LG_Camera |
light1 | A LG_Light |
landscape_rec | A Rec2Df, should be centered |
grid_width | Grid width, ie number of units along one row or one column, should be even - if odd, we substract one |
LG_SceneNode* lg_scenenode_new_and_set | ( | int | id, |
LG_SceneNode * | parent, | ||
const char * | mesh_file, | ||
LG_LoadMesh_Flags | flags, | ||
vec3_t | transl, | ||
LG_Quat | orientation, | ||
vec3_t | scaling | ||
) |
Helper func to create and set a new LG_SceneNode instance
Create node, add node to scene graph, load node's mesh, and set node's local matrix
Helper macros for less confusion:
Mesh must be freed when done with the scene
id | Node's id |
parent | A pointer to a scene graph node |
mesh_file | Relative path to mesh file to load, inside the mesh folder |
flags | Apply to mesh: force_reload, invert_z, normalize_xyz, horiz_center, vert_center, vert_bottom |
transl | Translation/position vec3 |
orientation | Orientation quat |
scaling | Scaling vec3 |