It's been awhile since I last posted. I will try to upload few posts this week to make up for it.
If you look at the history of my FarflungUE4 project, a port of previous galaxy generation project to UE4, you will notice that I've ditched the physics library wrappers: Vector3D, Quaternion, etc.
When I initially started on the original Farflung project, I didn't have a clear of rendering system I was going to use.
Looking back, the smart thing that I could have done was on my GalaxyGen module, I could have included a lightweight math library. This results in rendering module and GalaxyGen module using two different math libraries, but would have resulted in a significantly less work designing a abstract math library for GalaxyGen to share whatever math library a rendering engine came with. Both approaches would have kept GalaxyGen somewhat modular and less strongly coupled to a single rendering engine.
An abstract math library had advantage of sharing math library with the rendering engine while still keeping GalaxyGen somewhat modular. Problem is that an abstract math library is both very inefficient and time consuming to develop.
On the same note, if you are looking for non UE4 GalaxyGen library, check out earlier commits on FarflungUE4 or Farflung repo.
If you look at the history of my FarflungUE4 project, a port of previous galaxy generation project to UE4, you will notice that I've ditched the physics library wrappers: Vector3D, Quaternion, etc.
When I initially started on the original Farflung project, I didn't have a clear of rendering system I was going to use.
Looking back, the smart thing that I could have done was on my GalaxyGen module, I could have included a lightweight math library. This results in rendering module and GalaxyGen module using two different math libraries, but would have resulted in a significantly less work designing a abstract math library for GalaxyGen to share whatever math library a rendering engine came with. Both approaches would have kept GalaxyGen somewhat modular and less strongly coupled to a single rendering engine.
An abstract math library had advantage of sharing math library with the rendering engine while still keeping GalaxyGen somewhat modular. Problem is that an abstract math library is both very inefficient and time consuming to develop.
- Because abstract interface in C++ works via polymorphism and pointers all objects even temporary ones have to be heap allocated. Also, using +,-,*, etc math operator overloads on pointer can lead to a very ugly code.
- Factory class and deallocation function needs to be used for all math objects, since objects needs to be created on the rendering engine dll's heap. This not only increase the code complexity, but code very prone to memory leak.
- Math libraries differ hugely for complex operations such as finding tangent along a spline curve. When I was testing a spline star generator, getting tangent value in UE4 results in simply calling a USplineComponent method which interpolates a tangent value. In Bullet physics, you need to implement your own.
On the same note, if you are looking for non UE4 GalaxyGen library, check out earlier commits on FarflungUE4 or Farflung repo.