mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
change: skeletons are assets now, not content units
This commit is contained in:
parent
587c140a6b
commit
42c4716be2
17 changed files with 144 additions and 120 deletions
|
|
@ -12,7 +12,7 @@
|
|||
#include "typedefs.hpp"
|
||||
#include "util/Clock.hpp"
|
||||
|
||||
#include <entt/entity/registry.hpp>
|
||||
#include <entt/entity/fwd.hpp>
|
||||
#include <unordered_map>
|
||||
|
||||
struct EntityDef;
|
||||
|
|
@ -31,14 +31,15 @@ namespace rigging {
|
|||
class SkeletonConfig;
|
||||
}
|
||||
|
||||
class Entities {
|
||||
entt::registry registry;
|
||||
class Entities final {
|
||||
std::unique_ptr<entt::registry> registry;
|
||||
Level& level;
|
||||
std::unordered_map<entityid_t, entt::entity> entities;
|
||||
std::unordered_map<entt::entity, entityid_t> uids;
|
||||
entityid_t nextID = 1;
|
||||
util::Clock sensorsTickClock;
|
||||
util::Clock updateTickClock;
|
||||
Assets* assets = nullptr;
|
||||
|
||||
void updateSensors(
|
||||
Rigidbody& body, const Transform& tsf, std::vector<Sensor*>& sensors
|
||||
|
|
@ -53,6 +54,10 @@ public:
|
|||
|
||||
Entities(Level& level);
|
||||
|
||||
~Entities();
|
||||
|
||||
void setAssets(Assets& assets);
|
||||
|
||||
void clean();
|
||||
void updatePhysics(float delta);
|
||||
void update(float delta);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue