Fixed issue with frexp.

This commit is contained in:
Бранимир Караџић
2024-12-05 19:42:14 -08:00
parent b97e679fc8
commit e88e4bbad8
8 changed files with 50 additions and 44 deletions

View File

@@ -10,6 +10,21 @@
namespace bx
{
float frexp(float _a, int32_t* _outExp)
{
const uint32_t ftob = floatToBits(_a);
const uint32_t masked0 = uint32_and(ftob, kFloatExponentMask);
const uint32_t exp0 = uint32_srl(masked0, kFloatExponentBitShift);
const uint32_t masked1 = uint32_and(ftob, kFloatSignMask | kFloatMantissaMask);
const uint32_t bits = uint32_or(masked1, UINT32_C(0x3f000000) );
const float result = bitsToFloat(bits);
*_outExp = int32_t(exp0 - 0x7e);
return result;
}
void mtxLookAt(float* _result, const Vec3& _eye, const Vec3& _at, const Vec3& _up, Handedness::Enum _handedness)
{
const Vec3 view = normalize(