Cub3D
 
Loading...
Searching...
No Matches
Player functions

Functions used to make the player playable (no-clipping). More...

Functions

void solve_collision_x (t_data *data, float x_vel)
 Solver of collision on x axis.
 
void solve_collision_y (t_data *data, float y_vel)
 Solver of collision on y axis.
 
void resolve_collision_steps (t_data *data, float vel_x, float vel_y)
 Solver of collision on x and y using steps smaller than 1 unit, To use only when moving faster than 1 unit, when MOVEMENT_SPEED_FWD_BWD >= 1.0f or MOVEMENT_SPEED_LEFT_RIGHT >= 1.0f.
 

Detailed Description

Functions used to make the player playable (no-clipping).

Function Documentation

◆ resolve_collision_steps()

void resolve_collision_steps ( t_data * data,
float vel_x,
float vel_y )

Solver of collision on x and y using steps smaller than 1 unit, To use only when moving faster than 1 unit, when MOVEMENT_SPEED_FWD_BWD >= 1.0f or MOVEMENT_SPEED_LEFT_RIGHT >= 1.0f.

Parameters
[in,out]datadata structure
[in]vel_xvelocity on x axis
[in]vel_yvelocity on y axis
Here is the call graph for this function:

◆ solve_collision_x()

void solve_collision_x ( t_data * data,
float x_vel )

Solver of collision on x axis.

Parameters
[in,out]datadata structure
[in]x_velvelocity on x axis

◆ solve_collision_y()

void solve_collision_y ( t_data * data,
float y_vel )

Solver of collision on y axis.

Parameters
[in,out]datadata structure
[in]y_velvelocity on y axis