The application I’m working on ( a planetarium to be used primarily as a teaching aid on Oculus ) involves lots of individual objects representing planets, the background sky etc etc. I’ve settled on Babylon as the underlying framework, but before that I did some playing with aframe. The aframe component model seems to provide a very natural way of encapsulating the logic associated with updating individual objects so that it’s easy declaratively to create new ones, remove old ones, and update them only when dependencies have changed.
I’m trying to work out what the corresponding best practice is within Babylon. At the moment, I’m working on a small library which has entities with init and update methods, all part of an overall scene which has a set of string parameters. Each entity depends on one or more of the parameters and is updated only if a relevant parameter has changed since the last time round the render loop. Internally, each entity keeps track of a single mesh, or possibly a small set of related ones.
So far this works for my use-case, but am I reinventing the wheel, or completely missing the right way to use babylon’s observer model to achieve the same thing?