From df750578c4a3598861089cf69f298d6dd459bb81 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 1 Aug 2011 13:30:48 +0100 Subject: [PATCH 1/6] Ticket #114, fixed documentation --- glm/gtc/quaternion.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/gtc/quaternion.hpp b/glm/gtc/quaternion.hpp index 9aea66f4..4176aa81 100644 --- a/glm/gtc/quaternion.hpp +++ b/glm/gtc/quaternion.hpp @@ -53,7 +53,7 @@ namespace detail // Convertions //explicit tquat(valType const & pitch, valType const & yaw, valType const & roll); - //! pitch, yaw, roll + //! Build a quaternion from euler angles (pitch, yaw, roll), in radians. explicit tquat( tvec3 const & eulerAngles); explicit tquat( @@ -124,8 +124,8 @@ namespace detail namespace gtc{ namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and functions { - /// \addtogroup gtc_quaternion - ///@{ + /// @addtogroup gtc_quaternion + /// @{ //! Returns the length of the quaternion. //! From GLM_GTC_quaternion extension. @@ -232,7 +232,7 @@ namespace quaternion ///< GLM_GTC_quaternion extension: Quaternion types and fun //! Quaternion of high precision floating-point numbers. //! From GLM_GTC_quaternion extension. typedef detail::tquat highp_quat; - ///@} + /// @} } //namespace quaternion } //namespace gtc From 3a32e3d7c37e6254bfa22145d08c7352b1fac7a8 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 1 Aug 2011 14:02:20 +0100 Subject: [PATCH 2/6] Ticket #113, fixed quat product --- glm/gtc/quaternion.inl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glm/gtc/quaternion.inl b/glm/gtc/quaternion.inl index a5ab33e0..e846fdc4 100644 --- a/glm/gtc/quaternion.inl +++ b/glm/gtc/quaternion.inl @@ -474,7 +474,8 @@ namespace quaternion{ typename detail::tquat::value_type AngleRad = radians(angle); typename detail::tquat::value_type fSin = sin(AngleRad * T(0.5)); - return gtc::quaternion::cross(q, detail::tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); + return q * detail::tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin); + //return gtc::quaternion::cross(q, detail::tquat(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); } template From 2732d4bae574b71e3a071b6d0e60961d454dc123 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 1 Aug 2011 14:10:02 +0100 Subject: [PATCH 3/6] Fixed ticket #116, missing bit mask --- glm/gtx/color_cast.inl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glm/gtx/color_cast.inl b/glm/gtx/color_cast.inl index 5236869b..fe36dd22 100644 --- a/glm/gtx/color_cast.inl +++ b/glm/gtx/color_cast.inl @@ -356,10 +356,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_bgra_cast(uint32 color) { detail::tvec4 result; - result.x = static_cast(color >> 16) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 0) / static_cast(255); - result.w = static_cast(color >> 24) / static_cast(255); + result.x = static_cast((color >> 16) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 0) & 0xFF) / static_cast(255); + result.w = static_cast((color >> 24) & 0xFF) / static_cast(255); return result; } From 43eb90b1bf12ad69da05f0cbc0803316880a8679 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 1 Aug 2011 14:21:09 +0100 Subject: [PATCH 4/6] Ticket #116, fixed color casts --- glm/gtx/color_cast.inl | 328 ++++++++++++++++++++--------------------- 1 file changed, 164 insertions(+), 164 deletions(-) diff --git a/glm/gtx/color_cast.inl b/glm/gtx/color_cast.inl index fe36dd22..4cbaa638 100644 --- a/glm/gtx/color_cast.inl +++ b/glm/gtx/color_cast.inl @@ -204,9 +204,9 @@ template <> GLM_FUNC_QUALIFIER gtc::type_precision::f16vec3 f16_rgbx_cast(gtc::type_precision::uint32 color) { gtc::type_precision::f16vec3 result; - result.x = gtc::type_precision::f16(static_cast(color >> 0) / static_cast(255)); - result.y = gtc::type_precision::f16(static_cast(color >> 8) / static_cast(255)); - result.z = gtc::type_precision::f16(static_cast(color >> 16) / static_cast(255)); + result.x = gtc::type_precision::f16(static_cast((color >> 0) & 0xFF) / static_cast(255)); + result.y = gtc::type_precision::f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); + result.z = gtc::type_precision::f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); return result; } @@ -214,9 +214,9 @@ template <> GLM_FUNC_QUALIFIER gtc::type_precision::f16vec3 f16_xrgb_cast(gtc::type_precision::uint32 color) { gtc::type_precision::f16vec3 result; - result.x = gtc::type_precision::f16(static_cast(color >> 8) / static_cast(255)); - result.y = gtc::type_precision::f16(static_cast(color >> 16) / static_cast(255)); - result.z = gtc::type_precision::f16(static_cast(color >> 24) / static_cast(255)); + result.x = gtc::type_precision::f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); + result.y = gtc::type_precision::f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); + result.z = gtc::type_precision::f16(static_cast((color >> 24) & 0xFF) / static_cast(255)); return result; } @@ -224,9 +224,9 @@ template <> GLM_FUNC_QUALIFIER f16vec3 f16_bgrx_cast(uint32 color) { f16vec3 result; - result.x = f16(static_cast(color >> 16) / static_cast(255)); - result.y = f16(static_cast(color >> 8) / static_cast(255)); - result.z = f16(static_cast(color >> 0) / static_cast(255)); + result.x = f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); + result.y = f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); + result.z = f16(static_cast((color >> 0) & 0xFF) / static_cast(255)); return result; } @@ -234,9 +234,9 @@ template <> GLM_FUNC_QUALIFIER f16vec3 f16_xbgr_cast(uint32 color) { f16vec3 result; - result.x = f16(static_cast(color >> 24) / static_cast(255)); - result.y = f16(static_cast(color >> 16) / static_cast(255)); - result.z = f16(static_cast(color >> 8) / static_cast(255)); + result.x = f16(static_cast((color >> 24) & 0xFF) / static_cast(255)); + result.y = f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); + result.z = f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); return result; } @@ -244,10 +244,10 @@ template <> GLM_FUNC_QUALIFIER f16vec4 f16_rgba_cast(uint32 color) { f16vec4 result; - result.x = f16(static_cast(color >> 0) / static_cast(255)); - result.y = f16(static_cast(color >> 8) / static_cast(255)); - result.z = f16(static_cast(color >> 16) / static_cast(255)); - result.w = f16(static_cast(color >> 24) / static_cast(255)); + result.x = f16(static_cast((color >> 0) & 0xFF) / static_cast(255)); + result.y = f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); + result.z = f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); + result.w = f16(static_cast((color >> 24) & 0xFF) / static_cast(255)); return result; } @@ -255,10 +255,10 @@ template <> GLM_FUNC_QUALIFIER f16vec4 f16_argb_cast(uint32 color) { f16vec4 result; - result.x = f16(static_cast(color >> 8) / static_cast(255)); - result.y = f16(static_cast(color >> 16) / static_cast(255)); - result.z = f16(static_cast(color >> 24) / static_cast(255)); - result.w = f16(static_cast(color >> 0) / static_cast(255)); + result.x = f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); + result.y = f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); + result.z = f16(static_cast((color >> 24) & 0xFF) / static_cast(255)); + result.w = f16(static_cast((color >> 0) & 0xFF) / static_cast(255)); return result; } @@ -266,10 +266,10 @@ template <> GLM_FUNC_QUALIFIER f16vec4 f16_bgra_cast(uint32 color) { f16vec4 result; - result.x = f16(static_cast(color >> 16) / static_cast(255)); - result.y = f16(static_cast(color >> 8) / static_cast(255)); - result.z = f16(static_cast(color >> 0) / static_cast(255)); - result.w = f16(static_cast(color >> 24) / static_cast(255)); + result.x = f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); + result.y = f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); + result.z = f16(static_cast((color >> 0) & 0xFF) / static_cast(255)); + result.w = f16(static_cast((color >> 24) & 0xFF) / static_cast(255)); return result; } @@ -277,10 +277,10 @@ template <> GLM_FUNC_QUALIFIER f16vec4 f16_abgr_cast(uint32 color) { f16vec4 result; - result.x = f16(static_cast(color >> 24) / static_cast(255)); - result.y = f16(static_cast(color >> 16) / static_cast(255)); - result.z = f16(static_cast(color >> 8) / static_cast(255)); - result.w = f16(static_cast(color >> 0) / static_cast(255)); + result.x = f16(static_cast((color >> 24) & 0xFF) / static_cast(255)); + result.y = f16(static_cast((color >> 16) & 0xFF) / static_cast(255)); + result.z = f16(static_cast((color >> 8) & 0xFF) / static_cast(255)); + result.w = f16(static_cast((color >> 0) & 0xFF) / static_cast(255)); return result; } @@ -294,9 +294,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_rgbx_cast(uint32 color) { detail::tvec3 result; - result.x = static_cast(color >> 0) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 16) / static_cast(255); + result.x = static_cast((color >> 0) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 16) & 0xFF) / static_cast(255); return result; } @@ -304,9 +304,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_xrgb_cast(uint32 color) { detail::tvec3 result; - result.x = static_cast(color >> 8) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 24) / static_cast(255); + result.x = static_cast((color >> 8) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 24) & 0xFF) / static_cast(255); return result; } @@ -314,9 +314,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_bgrx_cast(uint32 color) { detail::tvec3 result; - result.x = static_cast(color >> 16) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 0) / static_cast(255); + result.x = static_cast((color >> 16) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 0) & 0xFF) / static_cast(255); return result; } @@ -324,9 +324,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_xbgr_cast(uint32 color) { detail::tvec3 result; - result.x = static_cast(color >> 24) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 8) / static_cast(255); + result.x = static_cast((color >> 24) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 8) & 0xFF) / static_cast(255); return result; } @@ -334,10 +334,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_rgba_cast(uint32 color) { detail::tvec4 result; - result.x = static_cast(color >> 0) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 16) / static_cast(255); - result.w = static_cast(color >> 24) / static_cast(255); + result.x = static_cast((color >> 0) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 16) & 0xFF) / static_cast(255); + result.w = static_cast((color >> 24) & 0xFF) / static_cast(255); return result; } @@ -345,10 +345,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_argb_cast(uint32 color) { detail::tvec4 result; - result.x = static_cast(color >> 8) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 24) / static_cast(255); - result.w = static_cast(color >> 0) / static_cast(255); + result.x = static_cast((color >> 8) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 24) & 0xFF) / static_cast(255); + result.w = static_cast((color >> 0) & 0xFF) / static_cast(255); return result; } @@ -367,10 +367,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_abgr_cast(uint32 color) { detail::tvec4 result; - result.x = static_cast(color >> 24) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 8) / static_cast(255); - result.w = static_cast(color >> 0) / static_cast(255); + result.x = static_cast((color >> 24) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 8) & 0xFF) / static_cast(255); + result.w = static_cast((color >> 0) & 0xFF) / static_cast(255); return result; } @@ -384,9 +384,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_rgbx_cast(uint32 color) { detail::tvec3 result; - result.x = static_cast(color >> 0) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 16) / static_cast(255); + result.x = static_cast((color >> 0) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 16) & 0xFF) / static_cast(255); return result; } @@ -394,9 +394,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_xrgb_cast(uint32 color) { detail::tvec3 result; - result.x = static_cast(color >> 8) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 24) / static_cast(255); + result.x = static_cast((color >> 8) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 24) & 0xFF) / static_cast(255); return result; } @@ -404,9 +404,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_bgrx_cast(uint32 color) { detail::tvec3 result; - result.x = static_cast(color >> 16) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 0) / static_cast(255); + result.x = static_cast((color >> 16) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 0) & 0xFF) / static_cast(255); return result; } @@ -414,9 +414,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_xbgr_cast(uint32 color) { detail::tvec3 result; - result.x = static_cast(color >> 24) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 8) / static_cast(255); + result.x = static_cast((color >> 24) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 8) & 0xFF) / static_cast(255); return result; } @@ -424,10 +424,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_rgba_cast(uint32 color) { detail::tvec4 result; - result.x = static_cast(color >> 0) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 16) / static_cast(255); - result.w = static_cast(color >> 24) / static_cast(255); + result.x = static_cast((color >> 0) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 16) & 0xFF) / static_cast(255); + result.w = static_cast((color >> 24) & 0xFF) / static_cast(255); return result; } @@ -435,10 +435,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_argb_cast(uint32 color) { detail::tvec4 result; - result.x = static_cast(color >> 8) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 24) / static_cast(255); - result.w = static_cast(color >> 0) / static_cast(255); + result.x = static_cast((color >> 8) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 24) & 0xFF) / static_cast(255); + result.w = static_cast((color >> 0) & 0xFF) / static_cast(255); return result; } @@ -446,10 +446,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_bgra_cast(uint32 color) { detail::tvec4 result; - result.x = static_cast(color >> 16) / static_cast(255); - result.y = static_cast(color >> 8) / static_cast(255); - result.z = static_cast(color >> 0) / static_cast(255); - result.w = static_cast(color >> 24) / static_cast(255); + result.x = static_cast((color >> 16) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 8) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 0) & 0xFF) / static_cast(255); + result.w = static_cast((color >> 24) & 0xFF) / static_cast(255); return result; } @@ -457,10 +457,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_abgr_cast(uint32 color) { detail::tvec4 result; - result.x = static_cast(color >> 24) / static_cast(255); - result.y = static_cast(color >> 16) / static_cast(255); - result.z = static_cast(color >> 8) / static_cast(255); - result.w = static_cast(color >> 0) / static_cast(255); + result.x = static_cast((color >> 24) & 0xFF) / static_cast(255); + result.y = static_cast((color >> 16) & 0xFF) / static_cast(255); + result.z = static_cast((color >> 8) & 0xFF) / static_cast(255); + result.w = static_cast((color >> 0) & 0xFF) / static_cast(255); return result; } @@ -474,9 +474,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f16_rgbx_cast(uint64 color) { detail::tvec3 result; - result.x = detail::thalf(static_cast(color >> 0) / static_cast(65535)); - result.y = detail::thalf(static_cast(color >> 16) / static_cast(65535)); - result.z = detail::thalf(static_cast(color >> 32) / static_cast(65535)); + result.x = detail::thalf(static_cast((color >> 0) & 0xFFFF) / static_cast(65535)); + result.y = detail::thalf(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); + result.z = detail::thalf(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); return result; } @@ -484,9 +484,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f16_xrgb_cast(uint64 color) { detail::tvec3 result; - result.x = detail::thalf(static_cast(color >> 16) / static_cast(65535)); - result.y = detail::thalf(static_cast(color >> 32) / static_cast(65535)); - result.z = detail::thalf(static_cast(color >> 48) / static_cast(65535)); + result.x = detail::thalf(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); + result.y = detail::thalf(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); + result.z = detail::thalf(static_cast((color >> 48) & 0xFFFF) / static_cast(65535)); return result; } @@ -494,9 +494,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f16_bgrx_cast(uint64 color) { detail::tvec3 result; - result.x = detail::thalf(static_cast(color >> 32) / static_cast(65535)); - result.y = detail::thalf(static_cast(color >> 16) / static_cast(65535)); - result.z = detail::thalf(static_cast(color >> 0) / static_cast(65535)); + result.x = detail::thalf(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); + result.y = detail::thalf(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); + result.z = detail::thalf(static_cast((color >> 0) & 0xFFFF) / static_cast(65535)); return result; } @@ -504,9 +504,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f16_xbgr_cast(uint64 color) { detail::tvec3 result; - result.x = detail::thalf(static_cast(color >> 48) / static_cast(65535)); - result.y = detail::thalf(static_cast(color >> 32) / static_cast(65535)); - result.z = detail::thalf(static_cast(color >> 16) / static_cast(65535)); + result.x = detail::thalf(static_cast((color >> 48) & 0xFFFF) / static_cast(65535)); + result.y = detail::thalf(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); + result.z = detail::thalf(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); return result; } @@ -514,10 +514,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f16_rgba_cast(uint64 color) { detail::tvec4 result; - result.x = detail::thalf(static_cast(color >> 0) / static_cast(65535)); - result.y = detail::thalf(static_cast(color >> 16) / static_cast(65535)); - result.z = detail::thalf(static_cast(color >> 32) / static_cast(65535)); - result.w = detail::thalf(static_cast(color >> 48) / static_cast(65535)); + result.x = detail::thalf(static_cast((color >> 0) & 0xFFFF) / static_cast(65535)); + result.y = detail::thalf(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); + result.z = detail::thalf(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); + result.w = detail::thalf(static_cast((color >> 48) & 0xFFFF) / static_cast(65535)); return result; } @@ -525,10 +525,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f16_argb_cast(uint64 color) { detail::tvec4 result; - result.x = detail::thalf(static_cast(color >> 16) / static_cast(65535)); - result.y = detail::thalf(static_cast(color >> 32) / static_cast(65535)); - result.z = detail::thalf(static_cast(color >> 48) / static_cast(65535)); - result.w = detail::thalf(static_cast(color >> 0) / static_cast(65535)); + result.x = detail::thalf(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); + result.y = detail::thalf(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); + result.z = detail::thalf(static_cast((color >> 48) & 0xFFFF) / static_cast(65535)); + result.w = detail::thalf(static_cast((color >> 0) & 0xFFFF) / static_cast(65535)); return result; } @@ -536,10 +536,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f16_bgra_cast(uint64 color) { detail::tvec4 result; - result.x = detail::thalf(static_cast(color >> 32) / static_cast(65535)); - result.y = detail::thalf(static_cast(color >> 16) / static_cast(65535)); - result.z = detail::thalf(static_cast(color >> 0) / static_cast(65535)); - result.w = detail::thalf(static_cast(color >> 48) / static_cast(65535)); + result.x = detail::thalf(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); + result.y = detail::thalf(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); + result.z = detail::thalf(static_cast((color >> 0) & 0xFFFF) / static_cast(65535)); + result.w = detail::thalf(static_cast((color >> 48) & 0xFFFF) / static_cast(65535)); return result; } @@ -547,10 +547,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f16_abgr_cast(uint64 color) { detail::tvec4 result; - result.x = detail::thalf(static_cast(color >> 48) / static_cast(65535)); - result.y = detail::thalf(static_cast(color >> 32) / static_cast(65535)); - result.z = detail::thalf(static_cast(color >> 16) / static_cast(65535)); - result.w = detail::thalf(static_cast(color >> 0) / static_cast(65535)); + result.x = detail::thalf(static_cast((color >> 48) & 0xFFFF) / static_cast(65535)); + result.y = detail::thalf(static_cast((color >> 32) & 0xFFFF) / static_cast(65535)); + result.z = detail::thalf(static_cast((color >> 16) & 0xFFFF) / static_cast(65535)); + result.w = detail::thalf(static_cast((color >> 0) & 0xFFFF) / static_cast(65535)); return result; } @@ -564,9 +564,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_rgbx_cast(uint64 color) { detail::tvec3 result; - result.x = static_cast(color >> 0) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 32) / static_cast(65535); + result.x = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); return result; } @@ -574,9 +574,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_xrgb_cast(uint64 color) { detail::tvec3 result; - result.x = static_cast(color >> 16) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 48) / static_cast(65535); + result.x = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); return result; } @@ -584,9 +584,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_bgrx_cast(uint64 color) { detail::tvec3 result; - result.x = static_cast(color >> 32) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 0) / static_cast(65535); + result.x = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); return result; } @@ -594,9 +594,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f32_xbgr_cast(uint64 color) { detail::tvec3 result; - result.x = static_cast(color >> 48) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 16) / static_cast(65535); + result.x = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); return result; } @@ -604,10 +604,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_rgba_cast(uint64 color) { detail::tvec4 result; - result.x = static_cast(color >> 0) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 32) / static_cast(65535); - result.w = static_cast(color >> 48) / static_cast(65535); + result.x = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); + result.w = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); return result; } @@ -615,10 +615,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_argb_cast(uint64 color) { detail::tvec4 result; - result.x = static_cast(color >> 16) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 48) / static_cast(65535); - result.w = static_cast(color >> 0) / static_cast(65535); + result.x = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); + result.w = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); return result; } @@ -626,10 +626,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_bgra_cast(uint64 color) { detail::tvec4 result; - result.x = static_cast(color >> 32) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 0) / static_cast(65535); - result.w = static_cast(color >> 48) / static_cast(65535); + result.x = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); + result.w = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); return result; } @@ -637,10 +637,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f32_abgr_cast(uint64 color) { detail::tvec4 result; - result.x = static_cast(color >> 48) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 16) / static_cast(65535); - result.w = static_cast(color >> 0) / static_cast(65535); + result.x = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); + result.w = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); return result; } @@ -654,9 +654,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_rgbx_cast(uint64 color) { detail::tvec3 result; - result.x = static_cast(color >> 0) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 32) / static_cast(65535); + result.x = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); return result; } @@ -664,9 +664,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_xrgb_cast(uint64 color) { detail::tvec3 result; - result.x = static_cast(color >> 16) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 48) / static_cast(65535); + result.x = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); return result; } @@ -674,9 +674,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_bgrx_cast(uint64 color) { detail::tvec3 result; - result.x = static_cast(color >> 32) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 0) / static_cast(65535); + result.x = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); return result; } @@ -684,9 +684,9 @@ template <> GLM_FUNC_QUALIFIER detail::tvec3 f64_xbgr_cast(uint64 color) { detail::tvec3 result; - result.x = static_cast(color >> 48) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 16) / static_cast(65535); + result.x = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); return result; } @@ -694,10 +694,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_rgba_cast(uint64 color) { detail::tvec4 result; - result.x = static_cast(color >> 0) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 32) / static_cast(65535); - result.w = static_cast(color >> 48) / static_cast(65535); + result.x = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); + result.w = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); return result; } @@ -705,10 +705,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_argb_cast(uint64 color) { detail::tvec4 result; - result.x = static_cast(color >> 16) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 48) / static_cast(65535); - result.w = static_cast(color >> 0) / static_cast(65535); + result.x = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); + result.w = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); return result; } @@ -716,10 +716,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_bgra_cast(uint64 color) { detail::tvec4 result; - result.x = static_cast(color >> 32) / static_cast(65535); - result.y = static_cast(color >> 16) / static_cast(65535); - result.z = static_cast(color >> 0) / static_cast(65535); - result.w = static_cast(color >> 48) / static_cast(65535); + result.x = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); + result.w = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); return result; } @@ -727,10 +727,10 @@ template <> GLM_FUNC_QUALIFIER detail::tvec4 f64_abgr_cast(uint64 color) { detail::tvec4 result; - result.x = static_cast(color >> 48) / static_cast(65535); - result.y = static_cast(color >> 32) / static_cast(65535); - result.z = static_cast(color >> 16) / static_cast(65535); - result.w = static_cast(color >> 0) / static_cast(65535); + result.x = static_cast((color >> 48) & 0xFFFF) / static_cast(65535); + result.y = static_cast((color >> 32) & 0xFFFF) / static_cast(65535); + result.z = static_cast((color >> 16) & 0xFFFF) / static_cast(65535); + result.w = static_cast((color >> 0) & 0xFFFF) / static_cast(65535); return result; } From c6fcd6c8d0081459c80d3e214846fcfce3b44846 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Mon, 1 Aug 2011 16:17:54 +0100 Subject: [PATCH 5/6] Getting ready GLM 0.9.2.4 release --- doc/src/data.xml | 14 +++++++++++++- readme.txt | 5 +++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/src/data.xml b/doc/src/data.xml index 6dda0edc..3bb0402e 100644 --- a/doc/src/data.xml +++ b/doc/src/data.xml @@ -3,6 +3,7 @@
+ @@ -66,6 +67,7 @@
+ @@ -156,9 +158,19 @@ + + + Fixed few bugs reported by GLM users. Thanks! + + + GLM 0.9.2.4 (zip) + GLM 0.9.2.4 (7z) + Submit a bug report + + - This version only fixes a couple a major bugs introduced in GLM 0.9.2.2. + This version only fixes a couple of major bugs introduced in GLM 0.9.2.2. GLM 0.9.2.3 (zip) diff --git a/readme.txt b/readme.txt index cc8337fd..0e7560a4 100644 --- a/readme.txt +++ b/readme.txt @@ -36,6 +36,11 @@ GLM is a header only library, there is nothing to build, just include it. More informations in GLM manual: http://glm.g-truc.net/glm-0.9.2.pdf +================================================================================ +GLM 0.9.2.4: 2011-08-04 +-------------------------------------------------------------------------------- +- Fixed extensions bugs + ================================================================================ GLM 0.9.2.3: 2011-06-08 -------------------------------------------------------------------------------- From 606383b2ae2416edf0e13b1a48df1cbcc87cf552 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Thu, 4 Aug 2011 12:53:21 +0100 Subject: [PATCH 6/6] Fixed GCC warning --- glm/core/_detail.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/core/_detail.hpp b/glm/core/_detail.hpp index 8f8a1c55..0748a83d 100644 --- a/glm/core/_detail.hpp +++ b/glm/core/_detail.hpp @@ -18,7 +18,7 @@ namespace detail { class thalf; -#if(__STDC_VERSION__ >= 199901L) // C99 detected, 64 bit types available +#if(__STDC_VERSION__ && (__STDC_VERSION__ >= 199901L)) // C99 detected, 64 bit types available typedef int64_t sint64; typedef uint64_t uint64; #elif(GLM_COMPILER & GLM_COMPILER_VC)