mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 04:24:47 +02:00
Correct references to isnan to glm::isnan for compat with Ubuntu 16.04/GCC 5.3
This commit is contained in:
parent
7b49552066
commit
b88fc62b97
3 changed files with 5 additions and 5 deletions
|
@ -388,7 +388,7 @@ void SwingTwistConstraint::dynamicallyAdjustLimits(const glm::quat& rotation) {
|
||||||
glm::vec3 swungY = swingRotation * Vectors::UNIT_Y;
|
glm::vec3 swungY = swingRotation * Vectors::UNIT_Y;
|
||||||
glm::vec3 swingAxis = glm::cross(Vectors::UNIT_Y, swungY);
|
glm::vec3 swingAxis = glm::cross(Vectors::UNIT_Y, swungY);
|
||||||
float theta = atan2f(-swingAxis.z, swingAxis.x);
|
float theta = atan2f(-swingAxis.z, swingAxis.x);
|
||||||
if (isnan(theta)) {
|
if (glm::isnan(theta)) {
|
||||||
// atan2f() will only return NaN if either of its arguments is NaN, which can only
|
// atan2f() will only return NaN if either of its arguments is NaN, which can only
|
||||||
// happen if we've been given a bad rotation. Since a NaN value here could potentially
|
// happen if we've been given a bad rotation. Since a NaN value here could potentially
|
||||||
// cause a crash (we use the value of theta to compute indices into a std::vector)
|
// cause a crash (we use the value of theta to compute indices into a std::vector)
|
||||||
|
|
|
@ -34,7 +34,7 @@ float PIDController::update(float measuredValue, float dt, bool resetAccumulator
|
||||||
if (getIsLogging()) { // if logging/reporting
|
if (getIsLogging()) { // if logging/reporting
|
||||||
updateHistory(measuredValue, dt, error, accumulatedError, changeInError, p, i, d, computedValue);
|
updateHistory(measuredValue, dt, error, accumulatedError, changeInError, p, i, d, computedValue);
|
||||||
}
|
}
|
||||||
Q_ASSERT(!isnan(computedValue));
|
Q_ASSERT(!glm::isnan(computedValue));
|
||||||
|
|
||||||
// update state for next time
|
// update state for next time
|
||||||
_lastError = error;
|
_lastError = error;
|
||||||
|
|
|
@ -18,7 +18,7 @@ void Settings::getFloatValueIfValid(const QString& name, float& floatValue) {
|
||||||
const QVariant badDefaultValue = NAN;
|
const QVariant badDefaultValue = NAN;
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
float tempFloat = value(name, badDefaultValue).toFloat(&ok);
|
float tempFloat = value(name, badDefaultValue).toFloat(&ok);
|
||||||
if (ok && !isnan(tempFloat)) {
|
if (ok && !glm::isnan(tempFloat)) {
|
||||||
floatValue = tempFloat;
|
floatValue = tempFloat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ void Settings::getVec3ValueIfValid(const QString& name, glm::vec3& vecValue) {
|
||||||
float x = value(QString("x"), badDefaultValue).toFloat(&ok);
|
float x = value(QString("x"), badDefaultValue).toFloat(&ok);
|
||||||
float y = value(QString("y"), badDefaultValue).toFloat(&ok);
|
float y = value(QString("y"), badDefaultValue).toFloat(&ok);
|
||||||
float z = value(QString("z"), badDefaultValue).toFloat(&ok);
|
float z = value(QString("z"), badDefaultValue).toFloat(&ok);
|
||||||
if (ok && (!isnan(x) && !isnan(y) && !isnan(z))) {
|
if (ok && (!glm::isnan(x) && !glm::isnan(y) && !glm::isnan(z))) {
|
||||||
vecValue = glm::vec3(x, y, z);
|
vecValue = glm::vec3(x, y, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ void Settings::getQuatValueIfValid(const QString& name, glm::quat& quatValue) {
|
||||||
float y = value(QString("y"), badDefaultValue).toFloat(&ok);
|
float y = value(QString("y"), badDefaultValue).toFloat(&ok);
|
||||||
float z = value(QString("z"), badDefaultValue).toFloat(&ok);
|
float z = value(QString("z"), badDefaultValue).toFloat(&ok);
|
||||||
float w = value(QString("w"), badDefaultValue).toFloat(&ok);
|
float w = value(QString("w"), badDefaultValue).toFloat(&ok);
|
||||||
if (ok && (!isnan(x) && !isnan(y) && !isnan(z) && !isnan(w))) {
|
if (ok && (!glm::isnan(x) && !glm::isnan(y) && !glm::isnan(z) && !glm::isnan(w))) {
|
||||||
quatValue = glm::quat(w, x, y, z);
|
quatValue = glm::quat(w, x, y, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue