mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 04:31:47 +00:00
Added lowestBitValue to GTX_bit #536
This commit is contained in:
parent
f71171d49b
commit
4db0dfcb19
@ -29,6 +29,10 @@ namespace glm
|
||||
template <typename genIUType>
|
||||
GLM_FUNC_DECL genIUType highestBitValue(genIUType Value);
|
||||
|
||||
/// @see gtx_bit
|
||||
template <typename genIUType>
|
||||
GLM_FUNC_DECL genIUType lowestBitValue(genIUType Value);
|
||||
|
||||
/// Find the highest bit set to 1 in a integer variable and return its value.
|
||||
///
|
||||
/// @see gtx_bit
|
||||
|
@ -25,6 +25,21 @@ namespace glm
|
||||
return detail::functor1<T, T, P, vecType>::call(highestBitValue, v);
|
||||
}
|
||||
|
||||
///////////////////
|
||||
// lowestBitValue
|
||||
|
||||
template <typename genIUType>
|
||||
GLM_FUNC_QUALIFIER genIUType lowestBitValue(genIUType Value)
|
||||
{
|
||||
return (Value & (~Value + 1));
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> lowestBitValue(vecType<T, P> const & v)
|
||||
{
|
||||
return detail::functor1<T, T, P, vecType>::call(lowestBitValue, v);
|
||||
}
|
||||
|
||||
///////////////////
|
||||
// powerOfTwoAbove
|
||||
|
||||
|
@ -67,6 +67,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
|
||||
- Added GTC_type_aligned with aligned *vec* types
|
||||
- Added GTC_functions extension
|
||||
- Added quaternion version of isnan and isinf #521
|
||||
- Added lowestBitValue to GTX_bit #536
|
||||
|
||||
##### Improvements:
|
||||
- Improved SIMD and swizzle operators interactions with GCC and Clang #474
|
||||
|
Loading…
Reference in New Issue
Block a user