![]() |
LibGame
v0.4.0
The LG Game Engine - Copyright (C) 2024-2025 ETMSoftware
|
Functions | |
| LG_Light | lg_light (lg_light_type type, vec3_t pos_or_dir, LG_Color_f color) |
| void | lg_set_light_src (LG_Light *light, vec3_t pos) |
| vec3_t | lg_get_light_src (LG_Light *light) |
| void | lg_move_light_src (LG_Light *light, vec3_t delta) |
| void | lg_set_light_dir (LG_Light *light, vec3_t dir) |
| vec3_t | lg_get_light_dir (LG_Light *light) |
| void | lg_change_light_dir (LG_Light *light, LG_EulerAng angle, const char *rot_order) |
=== It's all about scene lights position, direction, color ===
Use an array of LG_Light structs if you want to have several different lights in a scene
Lighting is actually a bit complicated:
TODO
| LG_Light lg_light | ( | lg_light_type | type, |
| vec3_t | pos_or_dir, | ||
| LG_Color_f | color | ||
| ) |
Return a new LG_Light
| type | Light type (lg_light_type enum), one of POINT, DIRECTIONAL, SPOTLIGHT, AMBIENT, DIFFUSE, EMISSIVE, SPECULAR |
| pos_or_dir | Source of light (vec3_t) in case of POINT light or light orientation (vec3_t) in case of DIRECTIONAL light |
| color | Light color |
Set light source position
| light | A LG_Light |
| pos | Light source pos |
Move light source position by delta
| light | A LG_Light |
| delta | Translation vector |
Set light orientation
| light | A LG_Light |
| dir | Light dir |
| void lg_change_light_dir | ( | LG_Light * | light, |
| LG_EulerAng | angle, | ||
| const char * | rot_order | ||
| ) |
Change light orientation by rotating by Euler angle
| light | A LG_Light |
| rot | Rotation to apply (Euler angle) |
| rot_order | Rotation order, one of "XYZ", "YXZ", "ZXY", "ZYX", "YZX", "XZY" |