Replies: 1 comment 2 replies
-
Very interesting. That does make a lot of sense, having increased precision for just the translation part. I feel like at this stage that it might be a bit niche for glam, or not something I'd want to take on at least. One day I'd like to make glams code generator a bit more reusable so that it's easier to extend glam in separate crates for things that I don't quite fit in glam. That's possibly not that straight forward though. I am not totally sure what people use I think you could probably optimize a lot for this specific case, you'd want to deal in doubles any time translation is involved, but if you could probably start using AVX2 a bit more, glam currently doesn't assume AVX2 but I think we're at a point that very few x86_64 machines won't have AVX. Of course glam also supports NEON and I don't know what the double support looks like there. |
Beta Was this translation helpful? Give feedback.
-
I've been working on binding Jolt Physics for Rust in my project
rolt
/joltc-sys
. Because glam and Jolt Physics have very similar types, glam has been an obvious choice for the math library of the high-level Rust wrapper.Jolt has a type that's really interesting, though. Their
DMat44
type stores the first three columns asf32
and only the last column asf64
. For the purposes of a physics engine, it makes sense that you don't need the rotation or scale part of the matrix as 64 bits, only the translation. This type is the type used for all world object matrices when double precision simulation is enabled.glam's equivalent
DMat4
type is allf64
, so these types don't quite line up.This has got me thinking: that mixed size matrix type sounds like a pretty good idea! So, questions:
DMat4
type for?f32
for as much as possible probably reduces memory usage and opens up some SIMD opportunities.Beta Was this translation helpful? Give feedback.
All reactions