Lales.Charles Posted October 5, 2021 Share Posted October 5, 2021 Hi, I could put this post in IG since it is currently linked to CIGI.. Use case: 1 master, n slaves in sphere and sensor groups One entity is loaded through CIGI Only sphere slaves render the new entity, eventually a sub node of it (e.g. static node), not the sensor ones (or vis-versa) Currently we see 2 approaches... with draw backs Callback on CIGI entity ctrl cmd received by master... ... but entity ctrl packet are also received for any update of position, orientation etc. So an intermediate collection of ids is required, with new id added triggering the cmd to the salves (currently implemented, with a sync cmd for slaves to apply a dedicated viewmask on camera and entity (sub node) surfaces..) Component system with registration to a controller triggering a collectionChanged even, and thus directly on each slave ... but it requires an empty component (just for registration at init) and a controller just for this feature Would you see any more elegant solution..? Kind regards, Charles Link to comment
cash-metall Posted October 6, 2021 Share Posted October 6, 2021 Hello! IGManager has OnCreateEntityCallback whitch called when new entity was created. but your idea with a Component is also very good: you can add a component that detects on which computer it was launched (getSynckerName) and sets the required viewport masks to meshes. this will help if you change the type of an already created entity 2 Link to comment
Lales.Charles Posted October 6, 2021 Author Share Posted October 6, 2021 Hi, IGManager OnCreateEntityCallback.. cool, I'll give a try! Yes component system can let each slave deal directly with their viewport.. but that need kind of artificial empty component. Another limitation is: in case of same entity loaded "statically" in the world, you'll get the same init.. whereas we may wish these entities to stay visible, you see what I mean? Kind regards, Charles Link to comment
cash-metall Posted October 6, 2021 Share Posted October 6, 2021 Quote Another limitation is: in case of same entity loaded "statically" in the world, you'll get the same init you can check in your component, that it is node from real entity Manager::findEntity(NodePtr node) if it is not an entity, this method return nullptr. 2 Link to comment
Recommended Posts