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

Public Member Functions

void is_body (bool *body)
 Checks if the given pointer represents a body.
 
void apply_impulse ()
 Applies an impulse to the physics body.
 
void add_shape (Node *child)
 Adds a child shape to the specified node.
 
void add_shape_and_realloc (Node *child)
 Adds a child shape to the specified node and reallocates memory if necessary.
 
void remove_shape (Node *child)
 Removes a child shape from the specified node.
 
void remove_shape_and_realloc (Node *child)
 Removes a child shape from the specified node and reallocates memory if necessary.
 
void remove_shape_and_free (Node *child)
 Removes a child shape from the specified node and frees the memory allocated for the child shape.
 
void remove_shape_and_free_and_realloc (Node *child)
 Removes a child shape from the specified node, frees the memory allocated for the child shape, and reallocates memory if necessary.
 
void get_collision_normal (float *normal)
 Calculates the collision normal vector.
 
- Public Member Functions inherited from PhysicalNode
void free ()
 Frees the resources allocated for the PhysicalNode instance.
 
- 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.
 

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
 
- Static Public Attributes inherited from Node
static Shader glowShader = 0
 A static Shader variable used for glow effect.
 

Member Function Documentation

◆ is_body()

void Body::is_body ( bool *  body)
inline

Checks if the given pointer represents a body.

This function takes a pointer to a boolean and performs a check to determine if it represents a body.

Parameters
bodyA pointer to a boolean that will be checked.

◆ apply_impulse()

void Body::apply_impulse ( )
inline

Applies an impulse to the physics body.

This function is responsible for applying an impulse to the physics body, which will affect its velocity and position based on the physics simulation.

Note
The specific details of how the impulse is calculated and applied are not provided in this snippet.

◆ add_shape()

void Body::add_shape ( Node child)
inline

Adds a child shape to the specified node.

Parameters
childThe child shape to be added to the node.

◆ add_shape_and_realloc()

void Body::add_shape_and_realloc ( Node child)
inline

Adds a child shape to the specified node and reallocates memory if necessary.

Parameters
nodeThe parent node to which the child shape will be added.
childThe child shape to be added to the node.

◆ remove_shape()

void Body::remove_shape ( Node child)
inline

Removes a child shape from the specified node.

Parameters
nodeThe parent node from which the child shape will be removed.
childThe child shape to be removed from the node.

◆ remove_shape_and_realloc()

void Body::remove_shape_and_realloc ( Node child)
inline

Removes a child shape from the specified node and reallocates memory if necessary.

Parameters
nodeThe parent node from which the child shape will be removed.
childThe child shape to be removed from the node.

◆ remove_shape_and_free()

void Body::remove_shape_and_free ( Node child)
inline

Removes a child shape from the specified node and frees the memory allocated for the child shape.

Parameters
nodeThe parent node from which the child shape will be removed.
childThe child shape to be removed and freed.

◆ remove_shape_and_free_and_realloc()

void Body::remove_shape_and_free_and_realloc ( Node child)
inline

Removes a child shape from the specified node, frees the memory allocated for the child shape, and reallocates memory if necessary.

Parameters
nodeThe parent node from which the child shape will be removed.
childThe child shape to be removed, freed, and reallocated.

◆ get_collision_normal()

void Body::get_collision_normal ( float *  normal)
inline

Calculates the collision normal vector.

This function computes the normal vector of a collision and stores it in the provided array.

Parameters
[out]normalA pointer to an array of floats where the collision normal vector will be stored.

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