commit 3d8c9a28872923363e9ca4940662d8cc4d11bbd1
parent d63ec7b80ebc432962e12b23acd2ec81ebbcb38c
Author: William Casarin <jb55@jb55.com>
Date: Sat, 27 Jul 2019 11:49:01 -0700
collide_terrain fn
Diffstat:
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/terrain.h b/src/terrain.h
@@ -45,6 +45,8 @@ struct terrain {
double old_noisy_boi(struct terrain *, double x, double y);
+
+void collide_terrain(struct terrain *terrain, struct node *node, struct model *model, vec3 *move);
void update_terrain(struct terrain *terrain, const double pdist);
void gen_terrain_samples(struct terrain *terrain, float scale, const double pdist);
void init_terrain(struct terrain *terrain, float size);
diff --git a/src/update.c b/src/update.c
@@ -340,8 +340,10 @@ static void player_update(struct game *game, struct entity *player)
struct terrain *terrain = &game->terrain;
player_terrain_collision(terrain, player);
+
node_recalc(node);
+ collide_terrain(terrain, node, NULL, NULL);
}