summaryrefslogtreecommitdiff
path: root/platformer/src/physics.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--platformer/src/physics.h4
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);