NovelRT icon indicating copy to clipboard operation
NovelRT copied to clipboard

Create a plugin interface for physics

Open Pheubel opened this issue 1 year ago • 2 comments

What is the current behaviour?

Currently there is no plugin interface for standardizing use of physics engines in NovelRT.

What is the expected behaviour/change?

There should be a basic plugin interface for any physics plugins to implement so that they can be easily swapped around.

What is the motivation / use case for changing the behavior?

With a standardised physics plugin interface, it will be easier for developers to implement a physics into their games, as it abstracts it away. It also allows them to try out different physics engines, like box2d or bullet without having to change their code base, as it would not have a specific implementation hard coded into their game.

Describe alternatives you've considered: Previously I attempted to implement Box2D more directly into NovelRT, but that caused more tight coupling that was not desired.

Are there any potential roadblocks or challenges facing this change?

As there are more than one physics engines out there, it might be hard to create a meaningful abstraction that can cover most use cases. Some engines might have different semantics that don't allow for easy unified abstractions.

Are there any downsides to implementing this change?

As mentioned above, it is most likely not possible to have the plugin interface be able to abstract over all features that a developer might want to have power over. However i do think that we'll be able to give them a solid base to work with.

Additional context This issue is related to https://github.com/novelrt/NovelRT/issues/84, as eventually there might be a plugin provider for box2d and bullet that would implement the physics plugin interface.

Pheubel avatar Feb 01 '23 12:02 Pheubel