Skip to content

Commit

Permalink
Fixed merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe committed Jul 12, 2019
2 parents 3a65b7a + f5381ef commit 9fbd011
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 27 deletions.
24 changes: 6 additions & 18 deletions glm/detail/type_quat.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
/// @ref gtc_quaternion
/// @file glm/gtc/quaternion.hpp
///
/// @see core (dependence)
/// @see gtc_constants (dependence)
///
/// @defgroup gtc_quaternion GLM_GTC_quaternion
/// @ingroup gtc
///
/// Include <glm/gtc/quaternion.hpp> to use the features of this extension.
///
/// Defines a templated quaternion type and several quaternion operations.
/// @ref core
/// @file glm/detail/type_quat.hpp

#pragma once

Expand All @@ -25,9 +15,6 @@

namespace glm
{
/// @addtogroup gtc_quaternion
/// @{

template<typename T, qualifier Q>
struct qua
{
Expand Down Expand Up @@ -55,7 +42,7 @@ namespace glm
# if GLM_LANG & GLM_LANG_CXXMS_FLAG
union
{
struct { T x, y, z, w;};
struct { T w, x, y, z;};

typename detail::storage<4, T, detail::is_aligned<Q>::value>::type data;
};
Expand All @@ -76,6 +63,7 @@ namespace glm
// -- Component accesses --

typedef length_t length_type;

/// Return the count of components of a quaternion
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;}

Expand Down Expand Up @@ -183,8 +171,8 @@ namespace glm

template<typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR bool operator!=(qua<T, Q> const& q1, qua<T, Q> const& q2);

/// @}
} //namespace glm

#ifndef GLM_EXTERNAL_TEMPLATE
#include "type_quat.inl"
#endif//GLM_EXTERNAL_TEMPLATE
6 changes: 3 additions & 3 deletions glm/detail/type_quat.inl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace detail
{
static GLM_FUNC_QUALIFIER T call(qua<T, Q> const& a, qua<T, Q> const& b)
{
vec<4, T, Q> tmp(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
vec<4, T, Q> tmp(a.w * b.w, a.x * b.x, a.y * b.y, a.z * b.z);
return (tmp.x + tmp.y) + (tmp.z + tmp.w);
}
};
Expand Down Expand Up @@ -74,14 +74,14 @@ namespace detail
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T & qua<T, Q>::operator[](typename qua<T, Q>::length_type i)
{
assert(i >= 0 && i < this->length());
return (&x)[i];
return (&w)[i];
}

template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T const& qua<T, Q>::operator[](typename qua<T, Q>::length_type i) const
{
assert(i >= 0 && i < this->length());
return (&x)[i];
return (&w)[i];
}

// -- Implicit basic constructors --
Expand Down
3 changes: 2 additions & 1 deletion glm/detail/type_vec4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ namespace glm

// -- Component accesses --

/// Return the count of components of the vector
typedef length_t length_type;

/// Return the count of components of the vector
GLM_FUNC_DECL static GLM_CONSTEXPR length_type length(){return 4;}

GLM_FUNC_DECL GLM_CONSTEXPR T & operator[](length_type i);
Expand Down
10 changes: 5 additions & 5 deletions glm/gtx/string_cast.inl
Original file line number Diff line number Diff line change
Expand Up @@ -450,10 +450,10 @@ namespace detail
LiteralStr, LiteralStr, LiteralStr, LiteralStr));

return detail::format(FormatStr.c_str(),
static_cast<typename cast<T>::value_type>(x[3]),
static_cast<typename cast<T>::value_type>(x[0]),
static_cast<typename cast<T>::value_type>(x[1]),
static_cast<typename cast<T>::value_type>(x[2]));
static_cast<typename cast<T>::value_type>(x[2]),
static_cast<typename cast<T>::value_type>(x[3]));
}
};

Expand All @@ -470,14 +470,14 @@ namespace detail
LiteralStr, LiteralStr, LiteralStr, LiteralStr));

return detail::format(FormatStr.c_str(),
static_cast<typename cast<T>::value_type>(x.real[3]),
static_cast<typename cast<T>::value_type>(x.real[0]),
static_cast<typename cast<T>::value_type>(x.real[1]),
static_cast<typename cast<T>::value_type>(x.real[2]),
static_cast<typename cast<T>::value_type>(x.dual[3]),
static_cast<typename cast<T>::value_type>(x.real[3]),
static_cast<typename cast<T>::value_type>(x.dual[0]),
static_cast<typename cast<T>::value_type>(x.dual[1]),
static_cast<typename cast<T>::value_type>(x.dual[2]));
static_cast<typename cast<T>::value_type>(x.dual[2]),
static_cast<typename cast<T>::value_type>(x.dual[3]));
}
};

Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ glm::mat4 camera(float Translate, glm::vec2 const& Rotate)
- Fixed ldexp and frexp declaration #895
- Fixed missing const to quaternion conversion operators #890
- Fixed EXT_scalar_ulp and EXT_vector_ulp API coding style
- Fixed quaternion componant order: w, {x, y, z} #916
### [GLM 0.9.9.5](https://github.com/g-truc/glm/releases/tag/0.9.9.5) - 2019-04-01
#### Fixes:
Expand Down

0 comments on commit 9fbd011

Please sign in to comment.