mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-08 17:57:02 +08:00
refactor(gameplay): extract physics and collision from ClientPlayer into PhysicalSystem
Move per-axis collision detection and move distance calculation to new PhysicalSystem. Move SpeedSystem implementation from inline header to separate .cpp file. Add const accessors to Entity. Replace inline AABB helper with HitboxManager registration of player hitbox using new PLAYER_SIZE constant. Remove obsolete members and functions from ClientPlayer.
This commit is contained in:
16
include/Cubed/gameplay/systems/physical_system.hpp
Normal file
16
include/Cubed/gameplay/systems/physical_system.hpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include "Cubed/gameplay/entity.hpp"
|
||||
#include "Cubed/gameplay/world.hpp"
|
||||
namespace Cubed {
|
||||
class PhysicalSystem {
|
||||
public:
|
||||
static glm::vec3 get_move_distance(float dt, const Entity& e);
|
||||
static std::tuple<bool, bool, bool> update(float dt, Entity& e,
|
||||
World& world);
|
||||
static std::tuple<bool, bool, bool>
|
||||
update(float dt, Entity& e, World& world, glm::vec3& moved_pos);
|
||||
|
||||
private:
|
||||
};
|
||||
} // namespace Cubed
|
||||
Reference in New Issue
Block a user