mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 00:13:53 +02:00
rename NaN functions for vec3 and quat
This commit is contained in:
parent
673182c091
commit
2633cb1f27
5 changed files with 12 additions and 27 deletions
|
@ -480,11 +480,5 @@ AACube& AACube::operator += (const glm::vec3& point) {
|
|||
}
|
||||
|
||||
bool AACube::containsNaN() const {
|
||||
if (isVec3NaN(_corner)) {
|
||||
return true;
|
||||
}
|
||||
if (isNaN(_scale)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return isNaN(_corner) || isNaN(_scale);
|
||||
}
|
||||
|
|
|
@ -425,10 +425,10 @@ void generateBasisVectors(const glm::vec3& primaryAxis, const glm::vec3& seconda
|
|||
vAxisOut = glm::cross(wAxisOut, uAxisOut);
|
||||
}
|
||||
|
||||
bool isVec3NaN(glm::vec3 value) {
|
||||
bool isNaN(glm::vec3 value) {
|
||||
return isNaN(value.x) || isNaN(value.y) || isNaN(value.z);
|
||||
}
|
||||
|
||||
bool isQuatNaN(glm::quat value) {
|
||||
bool isNaN(glm::quat value) {
|
||||
return isNaN(value.w) || isNaN(value.x) || isNaN(value.y) || isNaN(value.z);
|
||||
}
|
||||
|
|
|
@ -225,7 +225,7 @@ void generateBasisVectors(const glm::vec3& primaryAxis, const glm::vec3& seconda
|
|||
glm::vec3& uAxisOut, glm::vec3& vAxisOut, glm::vec3& wAxisOut);
|
||||
|
||||
|
||||
bool isVec3NaN(glm::vec3 value);
|
||||
bool isQuatNaN(glm::quat value);
|
||||
bool isNaN(glm::vec3 value);
|
||||
bool isNaN(glm::quat value);
|
||||
|
||||
#endif // hifi_GLMHelpers_h
|
||||
|
|
|
@ -315,7 +315,7 @@ glm::vec3 SpatiallyNestable::getPosition(int jointIndex, bool& success) const {
|
|||
|
||||
void SpatiallyNestable::setPosition(const glm::vec3& position, bool& success) {
|
||||
// guard against introducing NaN into the transform
|
||||
if (isVec3NaN(position)) {
|
||||
if (isNaN(position)) {
|
||||
success = false;
|
||||
return;
|
||||
}
|
||||
|
@ -364,7 +364,7 @@ glm::quat SpatiallyNestable::getOrientation(int jointIndex, bool& success) const
|
|||
|
||||
void SpatiallyNestable::setOrientation(const glm::quat& orientation, bool& success) {
|
||||
// guard against introducing NaN into the transform
|
||||
if (isQuatNaN(orientation)) {
|
||||
if (isNaN(orientation)) {
|
||||
success = false;
|
||||
return;
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ glm::vec3 SpatiallyNestable::getScale(int jointIndex) const {
|
|||
|
||||
void SpatiallyNestable::setScale(const glm::vec3& scale) {
|
||||
// guard against introducing NaN into the transform
|
||||
if (isVec3NaN(scale)) {
|
||||
if (isNaN(scale)) {
|
||||
qDebug() << "SpatiallyNestable::setLocalScale -- scale contains NaN";
|
||||
return;
|
||||
}
|
||||
|
@ -489,7 +489,7 @@ glm::vec3 SpatiallyNestable::getLocalPosition() const {
|
|||
|
||||
void SpatiallyNestable::setLocalPosition(const glm::vec3& position) {
|
||||
// guard against introducing NaN into the transform
|
||||
if (isVec3NaN(position)) {
|
||||
if (isNaN(position)) {
|
||||
qDebug() << "SpatiallyNestable::setLocalPosition -- position contains NaN";
|
||||
return;
|
||||
}
|
||||
|
@ -509,7 +509,7 @@ glm::quat SpatiallyNestable::getLocalOrientation() const {
|
|||
|
||||
void SpatiallyNestable::setLocalOrientation(const glm::quat& orientation) {
|
||||
// guard against introducing NaN into the transform
|
||||
if (isQuatNaN(orientation)) {
|
||||
if (isNaN(orientation)) {
|
||||
qDebug() << "SpatiallyNestable::setLocalOrientation -- orientation contains NaN";
|
||||
return;
|
||||
}
|
||||
|
@ -530,7 +530,7 @@ glm::vec3 SpatiallyNestable::getLocalScale() const {
|
|||
|
||||
void SpatiallyNestable::setLocalScale(const glm::vec3& scale) {
|
||||
// guard against introducing NaN into the transform
|
||||
if (isVec3NaN(scale)) {
|
||||
if (isNaN(scale)) {
|
||||
qDebug() << "SpatiallyNestable::setLocalScale -- scale contains NaN";
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -152,14 +152,5 @@ QJsonObject Transform::toJson(const Transform& transform) {
|
|||
}
|
||||
|
||||
bool Transform::containsNaN() const {
|
||||
if (isQuatNaN(_rotation)) {
|
||||
return true;
|
||||
}
|
||||
if (isVec3NaN(_scale)) {
|
||||
return true;
|
||||
}
|
||||
if (isVec3NaN(_translation)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return isNaN(_rotation) || isNaN(_scale) || isNaN(_translation);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue