From e4483eca01b48b943cd0461e24a74ae1a3139ed4 Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Wed, 12 Feb 2025 21:57:46 +1100 Subject: Update to most recent version (old initial commit) --- src/shared/movement.hh | 67 -------------------------------------------------- 1 file changed, 67 deletions(-) delete mode 100644 src/shared/movement.hh (limited to 'src/shared/movement.hh') diff --git a/src/shared/movement.hh b/src/shared/movement.hh deleted file mode 100644 index 375c030..0000000 --- a/src/shared/movement.hh +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef SHARED_MOVEMENT_HH_ -#define SHARED_MOVEMENT_HH_ - -#include "shared/math.hh" -#include "shared/player.hh" -#include "shared/shared.hh" -#include "shared/world.hh" - -#include -#include - -#include -#include - -namespace shared { -namespace movement { - -struct aabb { - glm::vec3 min; - glm::vec3 max; -}; -bool intersect_aabbs(const aabb& a, const aabb& b) noexcept; - -struct line { - glm::vec3 origin; - glm::vec3 dir; -}; -struct ray_aabb_ret { - glm::vec3 position; - float time; - glm::vec3 normal; -}; -std::optional intersect_ray_aabb(const line& line, - const aabb& aabb) noexcept; -struct moving_aabb { - struct aabb aabb; - glm::vec3 velocity; -}; -struct moving_aabb_ret { - float time; - glm::vec3 normal; -}; -std::optional -intersect_moving_aabbs(const moving_aabb& a, const moving_aabb& b) noexcept; - -// A block with a bit more info. -struct blockinfo { - shared::world::block block; - struct aabb aabb; - shared::math::coords chunk_pos; - glm::ivec3 pos; -}; -// /WE/ should use this function to generate our blockdatas. -constexpr int move_width = - static_cast(1.0f + 2 * shared::player::HALFWIDTH + 1.0f); -constexpr int move_height = static_cast(1.0f + shared::player::HEIGHT); - -// Walking a player is fairly complicated, and requires a std::vector of -// blockdata that represents all the blocks near a player. -// TODO provide an additional deltatime arugment to enable prediction. -void move(shared::player& player, const std::vector& blockinfos, - const float deltatime) noexcept; - -} // namespace movement -} // namespace shared - -#endif -- cgit v1.2.3