mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-10-08 15:21:12 +00:00
Add glm 0.9.2
This commit is contained in:
parent
21545e1a24
commit
c4b531ed5e
218 changed files with 46187 additions and 0 deletions
45
ExternalLibs/glm/gtx/unsigned_int.inl
Normal file
45
ExternalLibs/glm/gtx/unsigned_int.inl
Normal file
|
@ -0,0 +1,45 @@
|
|||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Created : 2005-12-24
|
||||
// Updated : 2008-10-07
|
||||
// Licence : This source is under MIT License
|
||||
// File : glm/gtx/unsigned_int.inl
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace glm{
|
||||
namespace gtx{
|
||||
namespace unsigned_int{
|
||||
|
||||
GLM_FUNC_QUALIFIER uint pow(uint x, uint y)
|
||||
{
|
||||
uint result = x;
|
||||
for(uint i = 1; i < y; ++i)
|
||||
result *= x;
|
||||
return result;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint sqrt(uint x)
|
||||
{
|
||||
if(x <= 1) return x;
|
||||
|
||||
uint NextTrial = x >> 1;
|
||||
uint CurrentAnswer;
|
||||
|
||||
do
|
||||
{
|
||||
CurrentAnswer = NextTrial;
|
||||
NextTrial = (NextTrial + x / NextTrial) >> 1;
|
||||
} while(NextTrial < CurrentAnswer);
|
||||
|
||||
return CurrentAnswer;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER uint mod(uint x, uint y)
|
||||
{
|
||||
return x - y * (x / y);
|
||||
}
|
||||
|
||||
}//namespace unsigned_int
|
||||
}//namespace gtx
|
||||
}//namespace glm
|
Loading…
Add table
Add a link
Reference in a new issue