MAGES Hub

The Hub contains and orchestrates all the different Modules in MAGES, assuring that there is no dependency handling and resulting in a standard initialization order of the core Modules. Systems are initialized and shutdown in a very specific manner, which allows the developer to implement any kind of system (or as we call it: Module) without compromising the integrity and clarity of everything else. The Hub has access and handles all the Modules implemented inside the Bundle that is used for the current project.

../../_images/hub.png

Bundles

A Bundle contains every Module that is used for the current project regarding MAGES NXT. It is fully customizable, meaning that the users can enable/disable any Module they desire. Furthermore, it is possible to create custom Modules, giving the options to the users to create the system they envision. The MAGES Bundle contains the following modules:

../../_images/mages_bundle_pt1.png
../../_images/mages_bundle_pt2.png

Module Name

Explanation

Scene Graph

The Scenegraph of the current project.

Data Container Module

The module that defines schemas and saves various data(e.g. analytics data)

Interaction System Module

The module supporting the interaction (e.g. holding objects, interaction with UIs etc).

Networking Module

The module managing the how the users connect to the multiplayer servers and how to handle the synchronization of the simulation state.

Analytics Module

The module that tracks the user’s performance and errors.

Device Manager Module

The module that handles input from the controllers, headsets and external devices in general.

Scene Graph Module

The module that manages the flow of the operation and defines the Action patterns.

Note

To modify the existing bundle, you can drag and drop your implementation of each module to the corresponding field.

To disable a module, the field regarding that module should not be set to None, instead the relative Stub Module should be selected.

Every module in the Bundle can be configured through MAGES > MAGES Panel > Advanced Settings.

../../_images/advanced_settings_tab.png

Examples and usage

The Hub is accessible across a MAGES project and it is used to call each module without referencing them directly.

You can call methods and variables from all modules with the Get method as the example below:

Hub.Instance.Get<InteractionSystemModule>().GetGrabbable(syringe).ExitSelection();

The code snippet above, calls the ExitSelection method (drops the object) from the InteractionSystemModule through the Hub.

Make sure to add the namespace using MAGES to access the Hub.

Hint

You can access many public functions and accessors when you are implementing custom scripts.