mirror of
https://github.com/g-truc/glm.git
synced 2025-04-13 08:43:00 +00:00
Declare specialized floattoXint functions
This commit is contained in:
parent
0c70a2b1ea
commit
78ab122ae0
1 changed files with 31 additions and 25 deletions
|
@ -1300,6 +1300,7 @@ namespace glm
|
|||
isnan(x.w));
|
||||
}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER int floatBitsToInt(float const & value)
|
||||
{
|
||||
union
|
||||
|
@ -1312,10 +1313,10 @@ namespace glm
|
|||
return fi.i;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<int> floatBitsToInt
|
||||
(
|
||||
detail::tvec2<T> const & value
|
||||
detail::tvec2<float> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec2<int>(
|
||||
|
@ -1323,28 +1324,32 @@ namespace glm
|
|||
floatBitsToInt(value.y));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<int> floatBitsToInt
|
||||
(
|
||||
detail::tvec3<T> const & value
|
||||
detail::tvec3<float> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec3<int>(
|
||||
floatBitsToInt(value.x),
|
||||
floatBitsToInt(value.y));
|
||||
floatBitsToInt(value.y),
|
||||
floatBitsToInt(value.z));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<int> floatBitsToInt
|
||||
(
|
||||
detail::tvec4<T> const & value
|
||||
detail::tvec4<float> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec4<int>(
|
||||
floatBitsToInt(value.x),
|
||||
floatBitsToInt(value.y));
|
||||
floatBitsToInt(value.y),
|
||||
floatBitsToInt(value.z),
|
||||
floatBitsToInt(value.w));
|
||||
}
|
||||
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER uint floatBitsToUint(float const & value)
|
||||
{
|
||||
union
|
||||
|
@ -1357,10 +1362,10 @@ namespace glm
|
|||
return fu.u;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<uint> floatBitsToUint
|
||||
(
|
||||
detail::tvec2<T> const & value
|
||||
detail::tvec2<float> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec2<uint>(
|
||||
|
@ -1368,10 +1373,10 @@ namespace glm
|
|||
floatBitsToUint(value.y));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<uint> floatBitsToUint
|
||||
(
|
||||
detail::tvec3<T> const & value
|
||||
detail::tvec3<float> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec3<uint>(
|
||||
|
@ -1380,10 +1385,10 @@ namespace glm
|
|||
floatBitsToUint(value.z));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<uint> floatBitsToUint
|
||||
(
|
||||
detail::tvec4<T> const & value
|
||||
detail::tvec4<float> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec4<uint>(
|
||||
|
@ -1405,10 +1410,10 @@ namespace glm
|
|||
return fi.f;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<float> intBitsToFloat
|
||||
(
|
||||
detail::tvec2<T> const & value
|
||||
detail::tvec2<int> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec2<float>(
|
||||
|
@ -1416,10 +1421,10 @@ namespace glm
|
|||
intBitsToFloat(value.y));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<float> intBitsToFloat
|
||||
(
|
||||
detail::tvec3<T> const & value
|
||||
detail::tvec3<int> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec3<float>(
|
||||
|
@ -1428,7 +1433,7 @@ namespace glm
|
|||
intBitsToFloat(value.z));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<float> intBitsToFloat
|
||||
(
|
||||
detail::tvec4<T> const & value
|
||||
|
@ -1441,6 +1446,7 @@ namespace glm
|
|||
intBitsToFloat(value.w));
|
||||
}
|
||||
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const & value)
|
||||
{
|
||||
union
|
||||
|
@ -1453,10 +1459,10 @@ namespace glm
|
|||
return fu.f;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER detail::tvec2<float> uintBitsToFloat
|
||||
(
|
||||
detail::tvec2<T> const & value
|
||||
detail::tvec2<uint> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec2<float>(
|
||||
|
@ -1464,10 +1470,10 @@ namespace glm
|
|||
uintBitsToFloat(value.y));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER detail::tvec3<float> uintBitsToFloat
|
||||
(
|
||||
detail::tvec3<T> const & value
|
||||
detail::tvec3<uint> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec3<float>(
|
||||
|
@ -1476,10 +1482,10 @@ namespace glm
|
|||
uintBitsToFloat(value.z));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER detail::tvec4<float> uintBitsToFloat
|
||||
(
|
||||
detail::tvec4<T> const & value
|
||||
detail::tvec4<uint> const & value
|
||||
)
|
||||
{
|
||||
return detail::tvec4<float>(
|
||||
|
|
Loading…
Add table
Reference in a new issue