Claude Chappe' Curse - A C Game
Logo Institut d'Informatique Claude Chappe Logo Université de Le Mans Logo Raeptor Production
 
Loading...
Searching...
No Matches
Light Class Reference
Inheritance diagram for Light:
Collaboration diagram for Light:

Public Member Functions

void init_light ()
 Initializes the light object.
 
void is_gui_element (bool *result)
 Determines if the current object is a GUI element.
 
void render (mat4 modelMatrix, Shader activeShader)
 Renders the light using the provided model matrix and active shader.
 
void init_vao ()
 Initializes the Vertex Array Object (VAO) for the light class.
 
void configure_lighting (WorldShaders *shaders, mat4 lightView, mat4 lightProjection, int storageBufferIndex, DepthMap *depthMap)
 Configures the lighting for the scene.
 
- Public Member Functions inherited from Node
void constructor ()
 Constructor for the Node class.
 
void initialize_node ()
 Initializes a node.
 
void get_glow_shader (Shader *shader)
 Retrieves the glow shader.
 
void get_settings_data (void ***ptr, int *length)
 Retrieves settings data.
 
void load ()
 Loads the necessary resources or data for the node.
 
void save (FILE *file)
 Saves the current state to the specified file.
 
void prepare_render (mat4 modelMatrix, Shader activeShader)
 Renders a node using the specified model matrix and shader.
 
void render ()
 Renders the node.
 
void update_global_position (vec3 pos, vec3 rot, vec3 scale)
 Updates the global position of a node.
 
void update (vec3 pos, vec3 rot, vec3 scale)
 Updates the position, rotation, and scale of a node.
 
void on_resize ()
 Handles the resize event for the node.
 
void free ()
 Frees the resources allocated by the object.
 
void is_cshape (bool *cshape)
 Checks if the current shape is a custom shape.
 
void is_body (bool *body)
 Sets the body status of the node.
 
void is_area (bool *area)
 Checks if the current node is within a specified area.
 
void is_render_target (bool *render_target)
 Sets the render target status.
 
void is_gui_element (bool *result)
 Determines if the current node is a GUI element.
 
void add_child (Node *child)
 Adds a child node to a parent node.
 
void add_child_and_realloc (Node *child)
 Adds a child node to a parent node and reallocates memory if necessary.
 
void remove_child (Node *child)
 Removes a child node from a parent node.
 
void remove_child_and_realloc (Node *child)
 Removes a child node from a parent node and reallocates memory if necessary.
 
void remove_child_and_free (Node *child)
 Removes a child node from a parent node and frees the memory of the child node.
 
void remove_child_and_free_and_realloc (Node *child)
 Removes a child node from a parent node, frees the memory of the child node, and reallocates memory if necessary.
 
int index_of_child (Node *child)
 Retrieves the index of a child node in a parent node's children array.
 
void print (int level)
 Prints the details of a node at a specified level of indentation.
 
void emit_ready (...)
 Emits the 'ready' signal for the node.
 
void emit_update (...)
 Emits an update event for the node.
 
void emit_signal (...)
 Emits a signal if the node has a script and the script has a signal handler.
 

Static Public Attributes

static VBO vbo = 0
 Static variable representing the Vertex Buffer Object (VBO) for the light class.
 
static VAO vao = 0
 Static variable representing the Vertex Array Object (VAO) for the light class.
 
static Shader billboardShader = 0
 Static variable representing the shader program used for rendering billboard lights.
 
static TextureMap lightPointTexture = 0
 Static variable representing the texture map for point lights.
 
static TextureMap directionalLightTexture = 0
 Static variable representing the texture map for directional lights.
 
- Static Public Attributes inherited from Node
static Shader glowShader = 0
 A static Shader variable used for glow effect.
 

Additional Inherited Members

- Public Attributes inherited from Node
void * object
 
struct Node ** children
 
struct Nodeparent
 
u16 length
 
u8 type
 
u8 flags
 
vec3 pos
 
vec3 rot
 
vec3 scale
 
vec3 globalPos
 
vec3 globalRot
 
vec3 globalScale
 
Behaviorbehavior
 
BehaviorAttributeattribute
 
u8 attributes_count
 
Shader shader
 

Member Function Documentation

◆ init_light()

void Light::init_light ( )
inline

Initializes the light object.

This function sets up the initial state of the light object, configuring any necessary parameters and preparing it for use in the application.

◆ is_gui_element()

void Light::is_gui_element ( bool *  result)
inline

Determines if the current object is a GUI element.

This function sets the value pointed to by the result parameter to indicate whether the current object is a graphical user interface (GUI) element.

Parameters
resultA pointer to a boolean variable where the result will be stored. The value will be set to true if the current object is a GUI element, and false otherwise.

◆ render()

void Light::render ( mat4  modelMatrix,
Shader  activeShader 
)
inline

Renders the light using the provided model matrix and active shader.

This function takes a model matrix and an active shader as parameters and performs the rendering of the light. The model matrix is used to transform the light's position and orientation in the scene, while the active shader is used to apply the appropriate shading effects.

Parameters
modelMatrixModel matrix used for transforming the light.
activeShaderThe shader program currently active for rendering.

◆ init_vao()

void Light::init_vao ( )
inline

Initializes the Vertex Array Object (VAO) for the light class.

This function sets up the VAO which is used to store the vertex attribute configuration for the light objects. It binds the necessary buffers and configures the vertex attributes.

◆ configure_lighting()

void Light::configure_lighting ( WorldShaders shaders,
mat4  lightView,
mat4  lightProjection,
int  storageBufferIndex,
DepthMap depthMap 
)
inline

Configures the lighting for the scene.

This function configures the lighting for the scene by setting the light properties in the shader.

Parameters
shadersThe shaders to be used for rendering.
lightViewThe view matrix for the light.
lightProjectionThe projection matrix for the light.
storageBufferIndexThe index of the storage buffer.

Member Data Documentation

◆ vbo

Light::vbo = 0
static

Static variable representing the Vertex Buffer Object (VBO) for the light class.

The VBO is used to store vertex data for rendering the lights in the OpenGL context.

◆ vao

Light::vao = 0
static

Static variable representing the Vertex Array Object (VAO) for the light class.

The VAO is used to store the vertex attribute configuration for rendering the lights in the OpenGL context.

◆ billboardShader

Light::billboardShader = 0
static

Static variable representing the shader program used for rendering billboard lights.

The shader program is used to render lights as billboards, which are 2D textures that always face the camera.

◆ lightPointTexture

Light::lightPointTexture = 0
static

Static variable representing the texture map for point lights.

The texture map is used to apply a texture to point lights, enhancing their visual appearance in the OpenGL context.

◆ directionalLightTexture

Light::directionalLightTexture = 0
static

Static variable representing the texture map for directional lights.

The texture map is used to apply a texture to directional lights, enhancing their visual appearance in the OpenGL context.


The documentation for this class was generated from the following file: