This PR expands functionality of plugin system. The purpose is that plugin can add new component what runtime can load (via plugin's runtime module).
Changes:
Add a new component type: PHYSICS.
Add optional CustomComponentConverter argument to constructor of Mundus runtime class. This converter can read read custom component properties.
New extension interfaces:
CustomShaderRenderExtension:
void render(Camera camera): Can render model with custom shader.
ComponentExtension:
Component.Type getComponentType(): Returns with the component type what the plugin use.
String getComponentName(): Returns with the component name.
Component createComponent(GameObject gameObject): Creates custom component for given game object.
void setupComponentInspectorWidget(Component component, RootWidget rootWidget): Setups widget for custom component for Inspector.
CustomComponentConverter getConverter(): Returns with converter for load and save properties for custom component.
Plugin's RootWidget additions:
addTextButton(String text, ButtonListener listener): Adds text button onto widget.
addSelectBox(Array<T> selectList, SelectBoxListener<T> listener): Adds dropdown/selectbox onto widget and the first item is the default selected..
addSelectBox(Array<T> selectList, T defaultValue, SelectBoxListener<T> listener): Adds dropdown/selectbox onto widget and can set the default selected value.
This PR expands functionality of plugin system. The purpose is that plugin can add new component what runtime can load (via plugin's runtime module).
Changes:
Add a new component type:
PHYSICS
.Add optional
CustomComponentConverter
argument to constructor of Mundus runtime class. This converter can read read custom component properties.New extension interfaces:
void render(Camera camera)
: Can render model with custom shader.Component.Type getComponentType()
: Returns with the component type what the plugin use.String getComponentName()
: Returns with the component name.Component createComponent(GameObject gameObject)
: Creates custom component for given game object.void setupComponentInspectorWidget(Component component, RootWidget rootWidget)
: Setups widget for custom component for Inspector.CustomComponentConverter getConverter()
: Returns with converter for load and save properties for custom component.Plugin's RootWidget additions:
addTextButton(String text, ButtonListener listener)
: Adds text button onto widget.addSelectBox(Array<T> selectList, SelectBoxListener<T> listener)
: Adds dropdown/selectbox onto widget and the first item is the default selected..addSelectBox(Array<T> selectList, T defaultValue, SelectBoxListener<T> listener)
: Adds dropdown/selectbox onto widget and can set the default selected value.addEmptyWidget()
: Adds an empty widget.clearWidgets()
: Clears the widget.Tested it with HTML and it works well.
Example: ode4j plugin.
You can try it with Mundus Example Project with Ode4j plugin: https://github.com/Dgzt/MundusRuntimeExample/tree/ode4j-plugin (use 1,2,3 buttons to throw shapes)