Use some LL definitions

meow-7.2.2
Ansariel 2020-04-15 21:01:32 +02:00
parent c5b6a150dc
commit b93a63a029
2 changed files with 5 additions and 10 deletions

View File

@ -29,7 +29,7 @@
#include "llviewercontrol.h"
#include "llmath.h" // normal build
#include "llviewerobject.h"
#include "llframetimer.h"
#include "llframetimer.h"
#include "fsregioncross.h"
//
// Improved region crossing time limit prediction.
@ -104,7 +104,7 @@ static inline F32 dividesafe(F32 num, F32 denom)
{ return((denom > FP_MAG_THRESHOLD // avoid divide by zero
|| denom < -FP_MAG_THRESHOLD)
? (num / denom)
: std::numeric_limits<F32>::infinity()); // return infinity if zero divide
: F32_MAX); // return infinity if zero divide
}
//
// getextraptimelimit -- don't extrapolate further ahead than this during a region crossing.
@ -121,11 +121,8 @@ F32 RegionCrossExtrapolateImpl::getextraptimelimit() const
LLQuaternion rot = mOwner.getRotationRegion(); // transform in global coords
const LLQuaternion& inverserot = rot.conjugate(); // transform global to local
// Calculate safe extrapolation time limit.
F32 extrapTimeLimit = std::min(
dividesafe(fsRegionCrossingPositionErrorLimit,
((mOwner.getVelocity()*inverserot - mFilteredVel.get()).length())),
dividesafe(fsRegionCrossingAngleErrorLimit,
((mOwner.getAngularVelocity()*inverserot - mFilteredAngVel.get()).length())));
F32 extrapTimeLimit = llmin(dividesafe(fsRegionCrossingPositionErrorLimit, ((mOwner.getVelocity()*inverserot - mFilteredVel.get()).length())),
dividesafe(fsRegionCrossingAngleErrorLimit, ((mOwner.getAngularVelocity()*inverserot - mFilteredAngVel.get()).length())));
LL_INFOS() << "Region cross extrapolation safe limit " << extrapTimeLimit << " secs." << LL_ENDL;
return(extrapTimeLimit); // do not extrapolate more than this
}

View File

@ -31,8 +31,6 @@
//
// Improved region crossing support.
//
#include <memory>
#include <limits>
class LLViewerObject; // forward declaration
@ -129,7 +127,7 @@ public:
F32 getextraptimelimit() const // get extrapolation time limit
{ if (mImpl.get()) { return(mImpl->getextraptimelimit()); } // get extrapolation time limit if vehicle
return(std::numeric_limits<F32>::infinity()); // no limit if not a vehicle
return(F32_MAX); // no limit if not a vehicle
}
};