MADEAPPS / newton-dynamics

Newton Dynamics is an integrated solution for real time simulation of physics environments.
http://www.newtondynamics.com
Other
936 stars 182 forks source link

Replace/Integrate GLM as mathematics backend #262

Open kklouzal opened 2 years ago

kklouzal commented 2 years ago

I propose replacing the current maths implementation with OpenGL Mathematics (GLM).

GLM is a very well established, feature rich, highly performant, header only, mathematics library.

A direct quote from their website: "This library works perfectly with OpenGL but it also ensures interoperability with other third party libraries and SDK. It is a good candidate for software rendering (raytracing / rasterization), image processing, physic simulations and any development context that requires a simple and convenient mathematics library."

Why?

While I understand this would require a substantial amount of upfront work, the end result will provide many enhancements to the speed, usability, maintainability, and future improvement of Newton.

Main cause for action:

  1. Applications already using GLM for their mathematics will have a 1:1 relationship calling functions and returning values from/to Newton/parent application. No need to constantly convert back and fourth.

  2. No need to waste valuable time creating, maintaining, worrying about a separate mathematics library. Just use GLM and have peace-of-mind knowing you have a highly stable, performant, feature rich mathematics implementation backed by hundreds of developers pushing constant updates and improvements.

  3. GLSL compliant variable types. When the time comes to implement Newton on the GPU with Vulkan, types offered with GLM will be easily passed back and fourth between CPU/GPU removing a layer of complexity that you might otherwise be up against.

I urge you to take time to seriously consider the pros and cons of such a change as I know this will benefit Newton in more ways than we could imagine.

https://github.com/g-truc/glm

JulioJerez commented 2 years ago

I appreciate the recomendation, GLM is very nice and feature rich but at this time, we are sticking with our version. It provides what we need with little overhead. there is also some functionality in ndMath that is not provide by libraries like GLM. Also newton is not an openGL application.

Hurleyworks commented 2 years ago

Here's another interesting library that you might want to check out for the future

https://github.com/mitsuba-renderer/enoki

On Sun, Dec 12, 2021 at 4:27 AM NewtonDynamics @.***> wrote:

I appreciate the recomendation, GLM is very nice and feature rich but at this time, we are sticking with our version. It provides what we need with little overhead. there is also some functionality in ndMath that is not provide by libraries like GLM. Also newton is not an openGL application.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MADEAPPS/newton-dynamics/issues/262#issuecomment-991862591, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB56PP2QCHLCDQLGCIIAQWLUQRTHRANCNFSM5J3ZTERQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- -Steve http://berserko.hurleyworks.com/ http://www.hurleyworks.com

kklouzal commented 2 years ago

Kind of thought so :)

GLM might have "openGL" in the name but it is not a graphics specific library, it is a highly performant general purpose mathematics library.

Just wanted to throw the idea out there for you to consider, personally I see a lot of benefit can be gained from making a move like this, but then again nobody knows the intricacies of the library like you do.

For you to not have to worry about maintaining the maths backend I figure would take a large chunk of the development overhead off your plate. The interoperability aspect we gain from making the change would be very nice too!

So just something to keep in the back of your mind!