summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorAnsariel <ansariel.hiller@phoenixviewer.com>2025-04-17 18:44:09 +0200
committerAnsariel <ansariel.hiller@phoenixviewer.com>2025-04-17 18:44:09 +0200
commitd65de99052d5ff08c7c4290a1f1b8e396105b8af (patch)
tree408a694dffae3592fd873dee8de789a163907283 /indra/newview
parent293462d8ff6dcb00ec501d026a6589d869a2f846 (diff)
Use standard library functions for llisnan and replace obvious NaN checks that don't work using /fp:fast floating point behavior under MSVC
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llphysicsmotion.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/indra/newview/llphysicsmotion.cpp b/indra/newview/llphysicsmotion.cpp
index 86291708b0..e5c84728fe 100644
--- a/indra/newview/llphysicsmotion.cpp
+++ b/indra/newview/llphysicsmotion.cpp
@@ -646,18 +646,17 @@ bool LLPhysicsMotion::onUpdate(F32 time)
velocity_new_local = 0;
}
- // Check for NaN values. A NaN value is detected if the variables doesn't equal itself.
- // If NaN, then reset everything.
- if ((mPosition_local != mPosition_local) ||
- (mVelocity_local != mVelocity_local) ||
- (position_new_local != position_new_local))
+ // Check for NaN values. If NaN, then reset everything.
+ if (llisnan(mPosition_local) ||
+ llisnan(mVelocity_local) ||
+ llisnan(position_new_local))
{
- position_new_local = 0;
- mVelocity_local = 0;
- mVelocityJoint_local = 0;
- mAccelerationJoint_local = 0;
- mPosition_local = 0;
- mPosition_world = LLVector3(0,0,0);
+ position_new_local = 0.f;
+ mVelocity_local = 0.f;
+ mVelocityJoint_local = 0.f;
+ mAccelerationJoint_local = 0.f;
+ mPosition_local = 0.f;
+ mPosition_world = LLVector3(0.f,0.f,0.f);
}
const F32 position_new_local_clamped = llclamp(position_new_local,