diff options
| author | Schark <jordan@schark.online> | 2026-09-29 23:36:45 -0400 |
|---|---|---|
| committer | Schark <jordan@schark.online> | 2026-09-29 23:36:45 -0400 |
| commit | 8af1210d45c3fa3f41a174d2906ab597dcc22f1c (patch) | |
| tree | 43f1a9814faae852af943f71de53d4ca38dc6cd2 /platformer/src/physics.h | |
| parent | fdc8c951fc72d9dc4c8faa58a21b2b9de0599698 (diff) | |
| download | gamedev-8af1210d45c3fa3f41a174d2906ab597dcc22f1c.tar.gz gamedev-8af1210d45c3fa3f41a174d2906ab597dcc22f1c.zip | |
Diffstat (limited to '')
| -rw-r--r-- | platformer/src/physics.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/platformer/src/physics.h b/platformer/src/physics.h index 9da41ac..9976aca 100644 --- a/platformer/src/physics.h +++ b/platformer/src/physics.h @@ -28,6 +28,9 @@ * Vec3 wall_normal; that side's outward normal (+-x or +-z, y = 0); * only meaningful if hit_wall * Box wall; the box that side belongs to; only meaningful if hit_wall + * float step_dy; how far a stair step moved the body up (+) or down (-) + * during the last step (0 if it didn't step), so the + * owner can smooth the pop out of what it draws * int ground_box; index (world_box) of the box the body stands on, or -1 * for the ground / in the air. Used to ride moving boxes. * } Body; @@ -64,6 +67,7 @@ typedef struct Body { Vec3 wall_normal; /* that side's outward normal (+-x or +-z); only if hit_wall */ Box wall; /* the box that side belongs to; only if hit_wall */ int ground_box; /* world_box index stood on (-1 = ground or airborne); for riding moving boxes */ + float step_dy; /* m a stair step moved the body this step (+ up, - down; 0 if none), for smoothing visuals */ } Body; void physics_step(Body *b, float dt); |
