ShikenNuggets / GadgetEngine

Yet another 3D game engine. But it's *my* 3D game engine :)
https://gamesbycarter.wordpress.com/2022/06/22/gadget-engine-c/
Other
2 stars 0 forks source link

Scene::GetAllComponentsInScene is overused #4

Open ShikenNuggets opened 11 months ago

ShikenNuggets commented 11 months ago

Scene::GetAllComponentsInScene performs dynamic_casts on every single Component of every single GameObject in the scene. Using it occasionally is fine, but doing this multiple times a frame every frame is inefficient., However, there is currently no alternative if, for example, the GameLogicManager needs to call Update on every GameLogicComponent. Implement an alternative.

ShikenNuggets commented 4 months ago

ComponentCollections should replace most GetAllComponentsInScene calls.