Closed JesseTG closed 10 years ago
I've never used Entity#disable
in any of my code - it's inherited from vanilla artemis.
Disabling an entity might possibly make sense if the entity is reused at some later point in time - disabling an entity effectively removes it from all systems (managers are notified as well). The entity itself and all its components remain untouched.
Deleting an entity:
com.artemis.Component
types are GC:ed just like normal java objectscom.artemis.PooledComponent
types are returned to the pool.com.artemis.PackedComponent
types are - depending on the impl - zeroed/reset (actually, this happens first when the entity is re-inserted into the World).I believe the initial addition of this came from the Gemserk guys: http://blog.gemserk.com/2012/01/03/reusing-artemis-entities-by-enabling-disabling-and-storing-them/
--tim
On Thu, Jun 5, 2014 at 10:29 AM, Adrian Papari notifications@github.com wrote:
I've never used Entity#disable in any of my code - it's inherited from vanilla artemis.
Disabling an entity might possibly make sense if the entity is reused at some later point in time - disabling an entity effectively removes it from all systems (managers are notified as well). The entity itself and all its components remain untouched.
Deleting an entity:
- the entity instance is returned to the pool for later reuse; component flags associated with the entity.id are cleared.
- normal com.artemis.Component types are GC:ed just like normal java objects
- com.artemis.PooledComponent types are returned to the pool.
- com.artemis.PackedComponent types are - depending on the impl - zeroed/reset (actually, this happens first when the entity is re-inserted into the World).
— Reply to this email directly or view it on GitHub https://github.com/junkdog/artemis-odb/issues/89#issuecomment-45234278.
Ah, cool - didn't remember that post. I frequented their blog when I first got started with artemis (and to a lesser extent, libgdx).
Funny trivia: I bumped into Michael Leahy (comments section) at some event in SF. Back then I was experimenting with my own, crude/naive message-passing component framework - he was working on something similar (TyphonRT) at the time - I did my best to absorb as much as could in my drunken stupor.
Awesome, thanks for the clarification!
Simple question. When would I want to use one over the other? I think in the original Artemis,
Entity.deleteFromWorld()
actually deleted the object, but I'm not sure what you guys are doing with pooling, so...