Closed osrf-migration closed 7 years ago
Original comment by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).
Created and modified are in pull request #7. I changed the name of WasModified()
to IsDifferent()
, and WAS_CHANGED
to WAS_MODIFIED
.
Original comment by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).
Original comment by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).
Original comment by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).
Fixed in pull request #7
Original report (archived issue) by Shane Loretz (Bitbucket: Shane Loretz, GitHub: sloretz).
Currently a system can query entities that have all required components. It gets a list of
EntityId
that match. This proposal is to add a way to see if a component on an entity has changed since the last update. It would mean :Entity::IsDifferent(ComponentType)
which returns 0 if the component was not modified, or a non-zero value indicating if the component was created, deleted, or just changed.Entity::Component()
to return a pointer to a const objectEntity::ComponentMutable()
to return a pointer to a non-const component for writing and set an internal flag that the component was modifiedManager
,EntityComponentDatabase
, andEntityQuery
.The purpose is to enable a system to update its internal state only if there have been changes. For example, a physics system would only change the shape of an object if the shape changed, or stop simulating a body if the component describing it was removed.
Example