DOML - D Open Math Library (JOML Translated To D)

jordan4ibanez jordan4ibanez002 at gmail.com
Sat Aug 20 00:03:35 UTC 2022


Hello.

For my first forum post I will share my effort over the past few 
days to help game developers that want to utilize D with an easy 
to understand library with lots of tutorials available.

This is why I translated JOML to D. Java Open Math Library is the 
most widely used libraries in Java game development. It is also 
very easy to understand. Used in games such as Minecraft and 
Project Zomboid, it is now available to D game devs.

You can see/get it here: https://code.dlang.org/packages/doml

DOML is built off the latest release at the time: 1.10.4

This is in alpha state, as in, I have rewritten every JOML unit 
test into D and made everything pass. But this cannot account for 
every function in every structure and every portion of the 
library. That is the part where you come in. If you find 
something incorrect, please, open a pull request or problem.

A major change from Java to D is not only the language, but also, 
utilizing D's powerful infrastructure. And I do mean that 
literally. Everything that was an object, is now a struct. 
Vector2i, Matrix4d, etc. If it makes sense for it to be an 
object, it's a struct now. This means that no GC hit with the new 
keyword. All the structs are just data. No complex overhead etc 
etc etc.

This library also follows in the footsteps of JOML with being 
completely modular. If you only need it for the math library or 
the Vector2i library, have at it.

Another major change from JOML is that there are no floating 
point structs, only doubles. No read only views either, as D can 
handle read only by simply not passing a struct in as a ref.

There are a few things missing, and this is because I wanted to 
get the base of the library up and running. I will hopefully be 
adding them in soon, such as the complex noise library. But I've 
talked long enough about it. I hope that this helps people, and 
thank you for reading.



More information about the Digitalmars-d mailing list