Claude Chappe' Curse - A C Game
Logo Institut d'Informatique Claude Chappe Logo Université de Le Mans Logo Raeptor Production
 
Loading...
Searching...
No Matches
Camera Class Reference

A structure to represent a camera with position and rotation in 3D space. More...

#include <camera.h>

Inheritance diagram for Camera:
Collaboration diagram for Camera:

Public Member Functions

void constructor ()
 Constructor for the Camera class.
 
void load (FILE *file, Camera **c, Script *scripts, Node *editor)
 Loads a Camera object from a file.
 
void update (vec3 pos, vec3 rot, vec3 scale)
 Updates the camera's position, rotation, and scale.
 
void get_settings_data (void ***ptr, int *length)
 Retrieves the settings data.
 
void save (FILE *file, Node *editor)
 Saves the state of the editor node to a file.
 
- 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.
 

Public Attributes

vec3 pos
 
vec3 rot
 
float fov
 
- 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
 

Additional Inherited Members

- Static Public Attributes inherited from Node
static Shader glowShader = 0
 A static Shader variable used for glow effect.
 

Detailed Description

A structure to represent a camera with position and rotation in 3D space.

Member Function Documentation

◆ constructor()

void Camera::constructor ( )
inline

Constructor for the Camera class.

This function initializes a new instance of the Camera class.

◆ load()

void Camera::load ( FILE *  file,
Camera **  c,
Script scripts,
Node editor 
)
inline

Loads a Camera object from a file.

This function reads data from the specified file and initializes a Camera object.

Parameters
fileA pointer to the file from which the Camera data will be read.
cA double pointer to the Camera object that will be initialized.
scriptsA pointer to the Script object associated with the Camera.
editorA pointer to the Node object representing the editor.

◆ update()

void Camera::update ( vec3  pos,
vec3  rot,
vec3  scale 
)
inline

Updates the camera's position, rotation, and scale.

This function updates the camera's transformation properties including position, rotation, and scale based on the provided vectors.

Parameters
posVec3 structure representing the new position of the camera.
rotVec3 structure representing the new rotation of the camera.
scaleVec3 structure representing the new scale of the camera.

◆ get_settings_data()

void Camera::get_settings_data ( void ***  ptr,
int *  length 
)
inline

Retrieves the settings data.

This function retrieves the settings data and stores it in the provided pointer. It also sets the length of the data.

Parameters
[out]ptrA pointer to a pointer to a pointer where the settings data will be stored. The function will allocate memory for the settings data and set this pointer to point to the allocated memory.
[out]lengthA pointer to an integer where the length of the settings data will be stored. The function will set this integer to the length of the settings data.

◆ save()

void Camera::save ( FILE *  file,
Node editor 
)
inline

Saves the state of the editor node to a file.

This function writes the current state of the editor node to the specified file.

Parameters
fileA pointer to the FILE object where the state will be saved.
editorA pointer to the Node object representing the editor whose state is to be saved.

Member Data Documentation

◆ pos

vec3 Camera::pos

Position of the camera.

◆ rot

vec3 Camera::rot

Rotation of the camera.

◆ fov

float Camera::fov

Field of view of the camera.


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