Banjo API 0.0.1
C99 game development API
Loading...
Searching...
No Matches
physics_2d.h File Reference
#include <banjo/api.h>
#include <banjo/math.h>
#include <banjo/vec.h>
Include dependency graph for physics_2d.h:

Go to the source code of this file.

Data Structures

struct  bj_particle_2d
struct  bj_angular_2d
struct  bj_rigid_body_2d

Functions

struct bj_vec2 bj_compute_kinematics_2d (struct bj_vec2 position, struct bj_vec2 velocity, struct bj_vec2 acceleration, bj_real time)
struct bj_vec2 bj_compute_kinematics_velocity_2d (struct bj_vec2 velocity, struct bj_vec2 acceleration, bj_real time)
void bj_apply_particle_force_2d (struct bj_particle_2d *particle, const struct bj_vec2 force)
void bj_step_particle_2d (struct bj_particle_2d *particle, bj_real dt)
void bj_apply_gravity_2d (struct bj_particle_2d *particle, bj_real gravity)
void bj_apply_point_gravity_2d (struct bj_particle_2d *restrict particle_from, const struct bj_particle_2d *restrict particle_to, const bj_real gravity_factor)
void bj_apply_point_gravity_softened_2d (struct bj_particle_2d *restrict particle_from, const struct bj_particle_2d *restrict particle_to, const bj_real gravity_factor, const bj_real epsilon)
void bj_apply_drag_2d (struct bj_particle_2d *particle, bj_real k1, bj_real k2)
bj_real bj_compute_particle_drag_coefficient_2d (const struct bj_vec2 vel, const bj_real k1, const bj_real k2)
struct bj_vec2 bj_compute_particle_drag_force_2d (struct bj_vec2 vel, const bj_real k1, const bj_real k2)
void bj_apply_angular_torque_2d (struct bj_angular_2d *angular, bj_real torque)
void bj_step_angular_2d (struct bj_angular_2d *angular, double delta_time)
void bj_apply_rigidbody_force_2d (struct bj_rigid_body_2d *body, const struct bj_vec2 force)
void bj_step_rigid_body_2d (struct bj_rigid_body_2d *body, double delta_time)

Detailed Description

Physics helpers (SI units, but dimensionally consistent with any unit system).