MonoGame.SplineFlower 1.2.0 - CatMulRomSplines!
I got asked by some people if the MonoGame.SplineFlower library is able to output CatMulRomSplines, but for the past 6 months I needed to say “NO”. I didn’t like that, because I know that CatMulRomSplines are pretty important in game development and… also pretty cool!
So… recently I finally managed to had some time to wrap my head around this topic and i’m quite happy to show you my results, because the library can now output CatMulRomSplines! “YES”
Take a look:
Just by looking at this gif you will clearly see why CatMulRomSplines are so great. Take a look at the yellow spline track and you will notice that it will pass tough all of the red control points. This is not the case for the BézierSpline which makes it naturally kinda hard for the developer to know where the yellow spline track will be when creating a BézierSpline within code.
But with a CatMulRomSpline you can be sure that the yellow track will hit every red control point at least one time and it passes exactly through the center of such a control point. This makes game development with splines more foreseeable (imagine race tracks or rail tracks).
- Added support for CatMulRomSplines.
- Added public static float SplineStepDistance so that the user can easily get the current step resolution of a specific spline.
- Added a SplineWalker to CatMulRom sample and looping the spline track.
- Direction vectors for CatMulRom splines have now the correct rotation / angle.
- Added possibility of showing or hideing the curves of a CatMulRomSpline.
- Json serialization updated accordingly.
- ContentPipeline support.
- Editor updated accordingly.
- Updated Readme.md file.
Creating a CatMulRomSpline is verry simple. Imagine you have a BézierSpline called “MySpline” and you want to convert it to a CatMulRomSpline. Then you just need to do this:
MySpline.CatMulRom = true;
Everything else happens automagically!
It’s also possible to convert already existing BézierSplines like this pretty easily.
Hope you like this update! It should work pretty stable, but it’s a fresh implementation so… bugs are possible
Have a nice day!
PS: NuGets updated too!