Jo Engine  2024.04.28
Jo Sega Saturn Engine
Data Structures | Functions
physics.h File Reference

Jo Engine File Physics function prototypes. More...

Go to the source code of this file.

Data Structures

struct  jo_sidescroller_physics_params
 

Functions

static __jo_force_inline void jo_physics_apply_friction (jo_sidescroller_physics_params *physics)
 Friction computation. More...
 
static __jo_force_inline void jo_physics_jump (jo_sidescroller_physics_params *physics)
 Jump computation. More...
 
static __jo_force_inline void jo_physics_apply_gravity (jo_sidescroller_physics_params *physics)
 Gravity computation. More...
 
static __jo_force_inline void jo_physics_accelerate_right (jo_sidescroller_physics_params *physics)
 Acceleration computation when going to the right. More...
 
static __jo_force_inline void jo_physics_accelerate_left (jo_sidescroller_physics_params *physics)
 Acceleration computation when going to the left. More...
 
static __jo_force_inline void jo_physics_decelerate_left (jo_sidescroller_physics_params *physics)
 Deceleration computation when going to the right. More...
 
static __jo_force_inline void jo_physics_decelerate_right (jo_sidescroller_physics_params *physics)
 Deceleration computation when going to the left. More...
 
static __jo_force_inline bool jo_physics_is_standing (jo_sidescroller_physics_params *physics)
 Check if we doesn't move. More...
 
static __jo_force_inline bool jo_physics_is_almost_standing (jo_sidescroller_physics_params *physics, float tolerance)
 Check if we almost doesn't move. More...
 
static __jo_force_inline bool jo_physics_is_going_on_the_right (jo_sidescroller_physics_params *physics)
 Check if we going on the right. More...
 
static __jo_force_inline bool jo_physics_is_going_on_the_left (jo_sidescroller_physics_params *physics)
 Check if we going on the left. More...
 
static __jo_force_inline bool jo_physics_should_brake (jo_sidescroller_physics_params *physics)
 Check if we should brake depending on the direction. More...
 
static __jo_force_inline void jo_physics_init_for_sonic (jo_sidescroller_physics_params *physics)
 Init physics engine for a Sonic like game. More...
 

Detailed Description

Jo Engine File Physics function prototypes.

Author
Johannes Fetz
Bug:
No known bugs.
Warning
Under development
Todo:

Fixed point math

Megaman, Contra Physics


Data Structure Documentation

◆ jo_sidescroller_physics_params

struct jo_sidescroller_physics_params
Data Fields
float acceleration_strength
float air_acceleration_strength
float braking_animation_speed
float deceleration_strength
float friction
float gravity
bool is_in_air
float jump_speed_y
float max_speed
float max_speed_y
float speed
float speed_y

Function Documentation

◆ jo_physics_accelerate_left()

static __jo_force_inline void jo_physics_accelerate_left ( jo_sidescroller_physics_params physics)
static

Acceleration computation when going to the left.

Parameters
physicsSidescroller physics properties

◆ jo_physics_accelerate_right()

static __jo_force_inline void jo_physics_accelerate_right ( jo_sidescroller_physics_params physics)
static

Acceleration computation when going to the right.

Parameters
physicsSidescroller physics properties

◆ jo_physics_apply_friction()

static __jo_force_inline void jo_physics_apply_friction ( jo_sidescroller_physics_params physics)
static

Friction computation.

Parameters
physicsSidescroller physics properties

◆ jo_physics_apply_gravity()

static __jo_force_inline void jo_physics_apply_gravity ( jo_sidescroller_physics_params physics)
static

Gravity computation.

Parameters
physicsSidescroller physics properties

◆ jo_physics_decelerate_left()

static __jo_force_inline void jo_physics_decelerate_left ( jo_sidescroller_physics_params physics)
static

Deceleration computation when going to the right.

Parameters
physicsSidescroller physics properties

◆ jo_physics_decelerate_right()

static __jo_force_inline void jo_physics_decelerate_right ( jo_sidescroller_physics_params physics)
static

Deceleration computation when going to the left.

Parameters
physicsSidescroller physics properties

◆ jo_physics_init_for_sonic()

static __jo_force_inline void jo_physics_init_for_sonic ( jo_sidescroller_physics_params physics)
static

Init physics engine for a Sonic like game.

Parameters
physicsSidescroller physics properties

◆ jo_physics_is_almost_standing()

static __jo_force_inline bool jo_physics_is_almost_standing ( jo_sidescroller_physics_params physics,
float  tolerance 
)
static

Check if we almost doesn't move.

Parameters
physicsSidescroller physics properties
toleranceTolerance
Returns
true if we almost doesn't move otherwise false

◆ jo_physics_is_going_on_the_left()

static __jo_force_inline bool jo_physics_is_going_on_the_left ( jo_sidescroller_physics_params physics)
static

Check if we going on the left.

Parameters
physicsSidescroller physics properties
Returns
true if we going on the left otherwise false

◆ jo_physics_is_going_on_the_right()

static __jo_force_inline bool jo_physics_is_going_on_the_right ( jo_sidescroller_physics_params physics)
static

Check if we going on the right.

Parameters
physicsSidescroller physics properties
Returns
true if we going on the right otherwise false

◆ jo_physics_is_standing()

static __jo_force_inline bool jo_physics_is_standing ( jo_sidescroller_physics_params physics)
static

Check if we doesn't move.

Parameters
physicsSidescroller physics properties
Returns
true if we doesn't move otherwise false

◆ jo_physics_jump()

static __jo_force_inline void jo_physics_jump ( jo_sidescroller_physics_params physics)
static

Jump computation.

Parameters
physicsSidescroller physics properties

◆ jo_physics_should_brake()

static __jo_force_inline bool jo_physics_should_brake ( jo_sidescroller_physics_params physics)
static

Check if we should brake depending on the direction.

Parameters
physicsSidescroller physics properties
Returns
true if we should brake depending on the direction otherwise false