Sign in to follow this  
jyk

Configurable Math Library Beta Release

Recommended Posts

jyk    2094
Hello all, I'm posting to announce the beta release of the CML (Configurable Math Library), a new, free C++ math library for games and graphics. Here is a link to the website: cmldev.net A feature list can be found here. For an overview of all functions offered by the CML, see this page. Key features of the library include: - Vector, matrix, and quaternion classes - Fixed-size and dynamically resizable vectors and matrices of arbitrary dimensions - Choice of row- or column-major storage for matrices - Choice of row- or column-vector notation for vector transforms - Choice of standard or 'reverse' quaternion multiplication order - Compatibility with both OpenGL and DirectX - A full library of transform and utility functions for both 2D and 3D - API-independent support for picking and frustum management - Fast, portable code based on expression templates and template metaprogramming I hope those of you who might be in need of a math library will consider the CML. Whether or not you try out the library, feel free to visit the forums and offer feedback on the design as presented on the site. Thanks for your time, Jesse

Share this post


Link to post
Share on other sites
pTymN    464
Looks nice. So it uses templates for everything? I was noticing that perp is 2d only. Do vector3's #ifdef out the perp method or something clever?

Share this post


Link to post
Share on other sites
jyk    2094
Quote:
So it uses templates for everything?
Yup, more or less. Although we realize some developers will only consider a math library if it incorporates assembly-level or platform-specific optimizations, our first priority (at least for v1.0) was portability.

That said, all indications are that it's plenty fast for most purposes - given a good compiler and maximum optimization settings, the expression template code offers performance comparable to hand-rolled C code.
Quote:
I was noticing that perp is 2d only. Do vector3's #ifdef out the perp method or something clever?
The correctness of expressions and function arguments is determined at compile time via template techniques - the preprocessor is not involved. If you write:
cml::vector3f v1(1,1,1);
cml::vector2f v2 = cml::perp(v1);
You'll simply get a compiler error indicating that the vector argument is of the wrong dimension.

Thanks for the reply, and for the questions. I've been working on this (with one other person) for a long time now, so needless to say I'm eager to get the word out and answer any questions you or anyone else might have about the library :-)

Share this post


Link to post
Share on other sites
Sign in to follow this