forked from skypjack/entt
-
Notifications
You must be signed in to change notification settings - Fork 0
Resources
Alan Jefferson edited this page Jan 23, 2020
·
1 revision
Sometimes your data needs to stay in sync with an externally managed resource, like a mesh or texture uploaded to the GPU or a rigid body managed by a simulation framework like PhysX.
WIP
Procedure
- Assign component, e.g. `registry.assign(entity);
- Observe construction
- Defer initialisation in PhysX, e.g.
for (auto entity: in observer) {}
- Store handle to initialised rigid body, e.g. `registry.assign<PxRigidDynamic*>(entity, handle);
- Associate
registry.remove<PxRigidDynamic*>
withhandle->release();
usingon_construct
Advantages
- Clear registry along with PhysX with
registry.reset();
- Clear single entity with
registry.destroy(entity);
- Clear PhysX, but leave your data, with
registry.reset<PxDynamicRigid*>();
EnTT - Fast and Reliable ECS (Entity Component System)
Table of contents
Examples
Blog
- RAII
- Polymorphism
- Shared Components
- Intent System
- Input Handling
- Undo
- Operator Stack
- State
- Resources
- Interpolation
Resources
Extras