I'm looking for a fast opensource C++ math-library for my game engine with the following features:
- fast (sse?)
- vectors
- matrices
- quaternions
suitable for both opengl and directx
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It only takes a minute to sign up.
Sign up to join this communityI'm looking for a fast opensource C++ math-library for my game engine with the following features:
suitable for both opengl and directx
XNA Math might be for you. It's a header only C++ math library that is distributed with the latest DirectX SDK and uses SSE intrinsics. I can't talk much about its performance but from what I read about it, it seems to be pretty decent.
EDIT: I'm also not sure about the licensing terms. The DX SDK Eula states that "Distributable Code" may not be
"run on a platform other than the Windows, Xbox and Windows Mobile platforms;"
I'm not entirely sure whether this applies for xna math as only sample and utility code is explicitly marked as "Distributable Code"
We use OpenGL Mathematics
Even though the name implies it's just for OpenGL I see no reason it wouldn't work for DirectX. It's a header only library, easy to use and is very actively updated.
Check it out.
Sony's vectormath library, used as part of Bullet Physics, meets all your requirements. Some work is involved to separate it from Bullet, but nothing serious - it doesn't depend on bullet, just that no one ever packaged it officially apart from it.
The version currently in the bullet tree supports SSE optimizations, and has a C++ interface.
An older version (probably now unsupported) also supports SOA formats, and a pure C interface.