mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-17 20:52:36 +01:00
Cleanup.
This commit is contained in:
@@ -375,7 +375,7 @@ float vertLerp(float* __restrict _result, float _iso, uint32_t _idx0, float _v0,
|
||||
const float* __restrict edge0 = s_cube[_idx0];
|
||||
const float* __restrict edge1 = s_cube[_idx1];
|
||||
|
||||
if (bx::fabsolute(_iso-_v1) < 0.00001f)
|
||||
if (bx::fabs(_iso-_v1) < 0.00001f)
|
||||
{
|
||||
_result[0] = edge1[0];
|
||||
_result[1] = edge1[1];
|
||||
@@ -383,8 +383,8 @@ float vertLerp(float* __restrict _result, float _iso, uint32_t _idx0, float _v0,
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
if (bx::fabsolute(_iso-_v0) < 0.00001f
|
||||
|| bx::fabsolute(_v0-_v1) < 0.00001f)
|
||||
if (bx::fabs(_iso-_v0) < 0.00001f
|
||||
|| bx::fabs(_v0-_v1) < 0.00001f)
|
||||
{
|
||||
_result[0] = edge0[0];
|
||||
_result[1] = edge0[1];
|
||||
|
||||
@@ -343,8 +343,8 @@ void VectorDisplay::endDraw()
|
||||
Line* lines = (Line*)alloca(nlines * sizeof(Line) );
|
||||
|
||||
float t = effectiveThickness();
|
||||
int first_last_same = bx::fabsolute(m_pendingPoints[0].x - m_pendingPoints[m_pendingPoints.size() - 1].x) < 0.1
|
||||
&& bx::fabsolute(m_pendingPoints[0].y - m_pendingPoints[m_pendingPoints.size() - 1].y) < 0.1;
|
||||
int first_last_same = bx::fabs(m_pendingPoints[0].x - m_pendingPoints[m_pendingPoints.size() - 1].x) < 0.1
|
||||
&& bx::fabs(m_pendingPoints[0].y - m_pendingPoints[m_pendingPoints.size() - 1].y) < 0.1;
|
||||
|
||||
// compute basics
|
||||
for (size_t i = 1; i < m_pendingPoints.size(); i++)
|
||||
|
||||
@@ -543,7 +543,7 @@ bool intersect(const Ray& _ray, const Cylinder& _cylinder, bool _capsule, Inters
|
||||
bx::vec3Cross(normal, _ray.m_dir, axis);
|
||||
|
||||
const float len = bx::vec3Norm(normal, normal);
|
||||
const float dist = bx::fabsolute(bx::vec3Dot(rc, normal) );
|
||||
const float dist = bx::fabs(bx::vec3Dot(rc, normal) );
|
||||
|
||||
if (dist > _cylinder.m_radius)
|
||||
{
|
||||
@@ -559,7 +559,7 @@ bool intersect(const Ray& _ray, const Cylinder& _cylinder, bool _capsule, Inters
|
||||
|
||||
const float rsq = bx::fsq(_cylinder.m_radius);
|
||||
const float ddoto = bx::vec3Dot(_ray.m_dir, vo);
|
||||
const float ss = t0 - bx::fabsolute(bx::fsqrt(rsq - bx::fsq(dist) ) / ddoto);
|
||||
const float ss = t0 - bx::fabs(bx::fsqrt(rsq - bx::fsq(dist) ) / ddoto);
|
||||
|
||||
float point[3];
|
||||
getPointAt(point, _ray, ss);
|
||||
|
||||
@@ -137,8 +137,8 @@ static void squircle(float* _out, float _angle)
|
||||
{
|
||||
float sa = bx::fsin(_angle);
|
||||
float ca = bx::fcos(_angle);
|
||||
_out[0] = bx::fsqrt(bx::fabsolute(sa) ) * bx::fsign(sa);
|
||||
_out[1] = bx::fsqrt(bx::fabsolute(ca) ) * bx::fsign(ca);
|
||||
_out[0] = bx::fsqrt(bx::fabs(sa) ) * bx::fsign(sa);
|
||||
_out[1] = bx::fsqrt(bx::fabs(ca) ) * bx::fsign(ca);
|
||||
}
|
||||
|
||||
uint32_t genSphere(uint8_t _subdiv0, void* _pos0 = NULL, uint16_t _posStride0 = 0, void* _normals0 = NULL, uint16_t _normalStride0 = 0)
|
||||
|
||||
@@ -1600,8 +1600,8 @@ int _main_(int _argc, char** _argv)
|
||||
float wh[3] = { float(view.m_info.width), float(view.m_info.height), 0.0f };
|
||||
float result[3];
|
||||
bx::vec3MulMtx(result, wh, orientation);
|
||||
result[0] = bx::fround(bx::fabsolute(result[0]) );
|
||||
result[1] = bx::fround(bx::fabsolute(result[1]) );
|
||||
result[0] = bx::fround(bx::fabs(result[0]) );
|
||||
result[1] = bx::fround(bx::fabs(result[1]) );
|
||||
|
||||
scale.set(bx::fmin(float(width) / result[0]
|
||||
, float(height) / result[1])
|
||||
|
||||
Reference in New Issue
Block a user