aboutsummaryrefslogtreecommitdiff
path: root/src/shared/movement.hh
diff options
context:
space:
mode:
authorNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-12 21:57:46 +1100
committerNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-12 21:57:46 +1100
commite4483eca01b48b943cd0461e24a74ae1a3139ed4 (patch)
treeed58c3c246e3af1af337697695d780aa31f6ad9a /src/shared/movement.hh
parent1cc08c51eb4b0f95c30c0a98ad1fc5ad3459b2df (diff)
Update to most recent version (old initial commit)
Diffstat (limited to 'src/shared/movement.hh')
-rw-r--r--src/shared/movement.hh67
1 files changed, 0 insertions, 67 deletions
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 <algorithm>
-#include <array>
-
-#include <glm/glm.hpp>
-#include <glm/gtx/norm.hpp>
-
-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<ray_aabb_ret> 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<moving_aabb_ret>
-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<int>(1.0f + 2 * shared::player::HALFWIDTH + 1.0f);
-constexpr int move_height = static_cast<int>(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<blockinfo>& blockinfos,
- const float deltatime) noexcept;
-
-} // namespace movement
-} // namespace shared
-
-#endif