News from Beta: New API
Modules and WHS 2
• modules - do you remember scene, renderer, camera, autoresize? Now all this is implemented using modules(new way to add things).
• World -> App - Why? Because world now doesn't contain physics, world doesn't handle camera, even scene... Now it only handles modules. And we moved all this to modules. No more stats in world when we basically don't need them.
• ModuleManager - new class used in App class to handle modules dependencies. Remember what i said about camera, scene, renderer, autoresize? Now them are CameraModule, SceneModule, RendererModule, AutoresizeModule. Last requires rendering and camera modules to be used in App. Those add their data to ModuleManager and AutoresizeModule can easily access them. It just needs to be invoked after camera and rendering module
Bonus: Inside information about physics module.
As you can understand from the title physics is now separate from whitestormjs core and even repo. Physics now has it's own life. Life of a physics module. But how can it be one module? It's simply a group of modules. For example for App class you need to set WorldModule. Components now have modules too, it makes them more flexible. For example we have WHS.Sphere and we want to make it be a physics object. Therefore we need to use new PHYSICS.SphereModule() on sphere component.