Description
What problem does this solve or what need does it fill?
For property based animation (i.e. "animate anything"), we need lower level Reflect utilities than ReflectComponent
for performant writes of the animated properties. For these systems we will likely have on hand a ComponentId, Entity (and thus EntityLocation), and a pre-parsed property path (see #4081).
What solution would you like?
Add another optional entry to the ComponentInfo
vtable. Preferably unsafe fn(Ptr<'a>) -> Option<&'a dyn Reflect>
and unsafe fn(PtrMut<'a>) -> &'a mut dyn Reflect
. Only the latter is really neededThis can be combined with Entity{Ref,Mut}::get_by_id
. Realistically these functions are going to just add the vtable pointer metadata to the underlying pointer.
Preferably we should be able to find a way to automatically register these hooks for all types that are registered that implement Component + Reflect
.
What alternative(s) have you considered?
Using ReflectComponent
as is, repeatedly fetching the same EntityRef
internally and TypeId
-> ComponentId
hashmap lookup for every property on every component on every animated entity.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status