mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-10-21 08:20:52 +00:00
Added numeric min/max for type.
This commit is contained in:
@@ -57,7 +57,7 @@ struct Camera
|
||||
|
||||
const bx::Vec3 toTarget = bx::sub(m_target.dest, m_pos.dest);
|
||||
const float toTargetLen = bx::length(toTarget);
|
||||
const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatMin);
|
||||
const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatSmallest);
|
||||
const bx::Vec3 toTargetNorm = bx::mul(toTarget, invToTargetLen);
|
||||
|
||||
float delta = toTargetLen * _dz;
|
||||
@@ -79,7 +79,7 @@ struct Camera
|
||||
|
||||
const bx::Vec3 toPos = bx::sub(m_pos.curr, m_target.curr);
|
||||
const float toPosLen = bx::length(toPos);
|
||||
const float invToPosLen = 1.0f / (toPosLen + bx::kFloatMin);
|
||||
const float invToPosLen = 1.0f / (toPosLen + bx::kFloatSmallest);
|
||||
const bx::Vec3 toPosNorm = bx::mul(toPos, invToPosLen);
|
||||
|
||||
float ll[2];
|
||||
@@ -109,7 +109,7 @@ struct Camera
|
||||
{
|
||||
const bx::Vec3 toTarget = bx::sub(m_target.curr, m_pos.curr);
|
||||
const float toTargetLen = bx::length(toTarget);
|
||||
const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatMin);
|
||||
const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatSmallest);
|
||||
const bx::Vec3 toTargetNorm = bx::mul(toTarget, invToTargetLen);
|
||||
|
||||
const bx::Vec3 right = bx::normalize(bx::cross({ 0.0f, 1.0f, 0.0f }, toTargetNorm) );
|
||||
|
||||
Reference in New Issue
Block a user