This new version of GLM is bringing a lot of improvements and maybe too many considering the development time it has required: API exposing SIMD implementation but also some new, safe and feature complet swizzling functions and a new setup API. All this is described in the largely updated GLM manual.

With the new setup system, GLM detects automatically the compiler settings to adapt its implementation to the flag set at build time. It will automatically enable C++0x features, SSE optimizations and the display configuration informations at build-time. The automatic setup can be overdrive by the GLM user.

The SIMD API maintly focus on vec4 and mat4 implementations that are embodied by the types simdVec4 and simdMat4. The implemention cover most of the common functions, the geometry functions and the matrix functions as described in the GLSL specifications. Because it is hight inefficient to access individual components of a SIMD register, the simdVec4 doesn't allow it. To reflect this constraint, the simdVec4 has to be converted to vec4 first which would be effectively handle by the compiler thank to the function simdCast. Furthermore, GLM provides some specials functions like simdDot4 that returns a simdVec4 instead of a float with the duplicated dot product value in each components and ensure that no unnecessary component manipulations are performed (typically __m128 to float and float to __m128). This implementation can probably be improve in many ways so don't hesitate to send me some feedbacks.



#include <glm/glm.hpp>



glm:: vec3 computeNormal

(

glm:: vec3 const & a,

glm:: vec3 const & b,

glm:: vec3 const & c

)

{

return glm::normalize(glm::cross(c - a, b - a));

}



#include <glm/glm.hpp>

#include <glm/gtx/simd_vec4.hpp>



glm:: simdVec4 computeNormal

(

glm:: simdVec4 const & a,

glm:: simdVec4 const & b,

glm:: simdVec4 const & c

)

{

return glm::simdNormalize(glm::simdCross(c - a, b - a));

}

GLM 0.9.1 is not 100% backward compatible with GLM 0.9.0 but mostly advanced usages should be concerned by this compatibility issues.

UPDATED: The SF.net mirrors are back.