mirror of
https://github.com/g-truc/glm.git
synced 2024-11-23 01:14:34 +00:00
Added int 10 10 10 2 extension
This commit is contained in:
parent
2fb86e9b77
commit
52d119f7c3
@ -41,6 +41,7 @@
|
|||||||
#include "./gtx/gradient_paint.hpp"
|
#include "./gtx/gradient_paint.hpp"
|
||||||
#include "./gtx/handed_coordinate_space.hpp"
|
#include "./gtx/handed_coordinate_space.hpp"
|
||||||
#include "./gtx/inertia.hpp"
|
#include "./gtx/inertia.hpp"
|
||||||
|
#include "./gtx/int_10_10_10_2.hpp"
|
||||||
#include "./gtx/integer.hpp"
|
#include "./gtx/integer.hpp"
|
||||||
#include "./gtx/intersect.hpp"
|
#include "./gtx/intersect.hpp"
|
||||||
#include "./gtx/inverse.hpp"
|
#include "./gtx/inverse.hpp"
|
||||||
|
@ -23,10 +23,8 @@ namespace glm
|
|||||||
namespace int_10_10_10_2
|
namespace int_10_10_10_2
|
||||||
{
|
{
|
||||||
//! From GLM_GTX_int_10_10_10_2 extension.
|
//! From GLM_GTX_int_10_10_10_2 extension.
|
||||||
int int10_10_10_2_cast(glm::vec4 const & v);
|
//! Cast a vec4 to an u_10_10_10_2.
|
||||||
|
dword uint10_10_10_2_cast(glm::vec4 const & v);
|
||||||
//! From GLM_GTX_int_10_10_10_2 extension.
|
|
||||||
uint uint10_10_10_2_cast(glm::vec4 const & v);
|
|
||||||
|
|
||||||
}//namespace integer
|
}//namespace integer
|
||||||
}//namespace gtx
|
}//namespace gtx
|
||||||
|
@ -11,16 +11,9 @@ namespace glm{
|
|||||||
namespace gtx{
|
namespace gtx{
|
||||||
namespace int_10_10_10_2
|
namespace int_10_10_10_2
|
||||||
{
|
{
|
||||||
//! From GLM_GTX_int_10_10_10_2 extension.
|
dword uint10_10_10_2_cast(glm::vec4 const & v)
|
||||||
int int10_10_10_2_cast(glm::vec4 const & v)
|
|
||||||
{
|
{
|
||||||
return int(v.x * 2047.f) << 0 | int(v.y * 2047.f) << 10 | int(v.z * 2047.f) << 20 | int(v.w * 3.f) << 30;
|
return dword(uint(v.x * 2047.f) << 0 | uint(v.y * 2047.f) << 10 | uint(v.z * 2047.f) << 20 | uint(v.w * 3.f) << 30);
|
||||||
}
|
|
||||||
|
|
||||||
//! From GLM_GTX_int_10_10_10_2 extension.
|
|
||||||
uint uint10_10_10_2_cast(glm::vec4 const & v)
|
|
||||||
{
|
|
||||||
return uint(v.x * 2047.f) << 0 | uint(v.y * 2047.f) << 10 | uint(v.z * 2047.f) << 20 | uint(v.w * 3.f) << 30;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}//namespace int_10_10_10_2
|
}//namespace int_10_10_10_2
|
||||||
|
Loading…
Reference in New Issue
Block a user