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

Public Member Functions

void is_cshape (bool *cshape)
 Checks if the given shape is a cshape.
 
void get_model (Model **model)
 Retrieves the model associated with the CShape.
 
void get_shader (Shader *shader)
 Retrieves the shader information.
 
void prepare_render (mat4 modelMatrix, Shader activeShader)
 Prepares the rendering process by setting up the model matrix and activating the shader.
 
void render (mat4 modelMatrix, Shader activeShader)
 Renders the shape using the provided model matrix and active shader.
 
- 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 Shader collisionShader
 Shader used for collision detection.
 
- 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

◆ is_cshape()

void CShape::is_cshape ( bool *  cshape)
inline

Checks if the given shape is a cshape.

This function sets the value of the boolean pointer to indicate whether the shape is a cshape.

Parameters
cshapeA pointer to a boolean variable that will be set to true if the shape is a cshape, false otherwise.

◆ get_model()

void CShape::get_model ( Model **  model)
inline

Retrieves the model associated with the CShape.

This function assigns the model associated with the CShape to the provided pointer. The model is returned as a double pointer to allow modification of the original pointer passed by the caller.

Parameters
[out]modelA double pointer to a Model structure where the model associated with the CShape will be stored.

◆ get_shader()

void CShape::get_shader ( Shader shader)
inline

Retrieves the shader information.

This function is responsible for obtaining the shader information and storing it in the provided Shader structure.

Parameters
shaderA pointer to a Shader structure where the shader information will be stored.

◆ prepare_render()

void CShape::prepare_render ( mat4  modelMatrix,
Shader  activeShader 
)
inline

Prepares the rendering process by setting up the model matrix and activating the shader.

This function is responsible for preparing the necessary components for rendering a shape. It takes a model matrix and an active shader as parameters and performs the required setup.

Parameters
modelMatrixModel matrix (of type mat4) that will be used for rendering. The model matrix contains the transformations (translation, rotation, scaling) that will be applied to the shape before rendering.
activeShaderThe shader program (of type Shader) that will be used for rendering. The shader program contains the vertex and fragment shaders that will be applied to the shape during rendering.

◆ render()

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

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

This function takes a model matrix and an active shader as parameters and renders the shape accordingly. The model matrix is used to transform the shape in the 3D space, and the active shader is used to apply shading effects during the rendering process.

Parameters
modelMatrixMat4 structure representing the model matrix. This matrix is used to transform the shape in the 3D space.
activeShaderAn instance of the Shader structure representing the active shader. This shader is used to apply shading effects during the rendering process.

Member Data Documentation

◆ collisionShader

Shader CShape::collisionShader
static

Shader used for collision detection.

This static variable holds the shader program used to detect collisions between shapes. The shader is initialized and used within the CShape class to perform collision detection operations.


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