|
Jo Engine
2024.04.28
Jo Sega Saturn Engine
|
Go to the documentation of this file.
38 #ifndef __JO_PHYSICS_H__
39 # define __JO_PHYSICS_H__
152 return (physics->
speed > 0.0f);
161 return (physics->
speed < 0.0f);
193 physics->
speed = 0.0f;
float speed_y
Definition: physics.h:54
#define JO_MAX(A, B)
Get the bigger value between A and B.
Definition: math.h:242
static __jo_force_inline void jo_physics_accelerate_left(jo_sidescroller_physics_params *physics)
Acceleration computation when going to the left.
Definition: physics.h:99
static __jo_force_inline bool jo_physics_is_standing(jo_sidescroller_physics_params *physics)
Check if we doesn't move.
Definition: physics.h:131
float speed
Definition: physics.h:53
float friction
Definition: physics.h:46
float max_speed_y
Definition: physics.h:49
float jump_speed_y
Definition: physics.h:52
static __jo_force_inline bool jo_is_float_equals_zero(const float f)
Check if float almost equals 0.
Definition: math.h:1731
static __jo_force_inline void jo_physics_apply_gravity(jo_sidescroller_physics_params *physics)
Gravity computation.
Definition: physics.h:80
static __jo_force_inline void jo_physics_accelerate_right(jo_sidescroller_physics_params *physics)
Acceleration computation when going to the right.
Definition: physics.h:90
float braking_animation_speed
Definition: physics.h:50
#define JO_ABS(X)
Get the absolute value of X.
Definition: math.h:225
static __jo_force_inline void jo_physics_init_for_sonic(jo_sidescroller_physics_params *physics)
Init physics engine for a Sonic like game.
Definition: physics.h:182
static __jo_force_inline bool jo_physics_should_brake(jo_sidescroller_physics_params *physics)
Check if we should brake depending on the direction.
Definition: physics.h:168
#define __jo_force_inline
force inline attribute (and prevent Doxygen prototype parsing bug)
Definition: types.h:39
bool is_in_air
Definition: physics.h:43
#define JO_CHANGE_SIGN(X)
Change the sign of X.
Definition: math.h:247
static __jo_force_inline bool jo_physics_is_going_on_the_right(jo_sidescroller_physics_params *physics)
Check if we going on the right.
Definition: physics.h:150
static __jo_force_inline void jo_physics_jump(jo_sidescroller_physics_params *physics)
Jump computation.
Definition: physics.h:72
float gravity
Definition: physics.h:51
float max_speed
Definition: physics.h:48
#define JO_MIN(A, B)
Get the smaller value between A and B.
Definition: math.h:236
static __jo_force_inline bool jo_physics_is_almost_standing(jo_sidescroller_physics_params *physics, float tolerance)
Check if we almost doesn't move.
Definition: physics.h:141
float acceleration_strength
Definition: physics.h:45
static __jo_force_inline void jo_physics_decelerate_right(jo_sidescroller_physics_params *physics)
Deceleration computation when going to the left.
Definition: physics.h:117
float air_acceleration_strength
Definition: physics.h:44
static __jo_force_inline bool jo_physics_is_going_on_the_left(jo_sidescroller_physics_params *physics)
Check if we going on the left.
Definition: physics.h:159
static __jo_force_inline void jo_physics_apply_friction(jo_sidescroller_physics_params *physics)
Friction computation.
Definition: physics.h:64
static __jo_force_inline void jo_physics_decelerate_left(jo_sidescroller_physics_params *physics)
Deceleration computation when going to the right.
Definition: physics.h:108
float deceleration_strength
Definition: physics.h:47