Account for collisionGroup in CollisionRegion implementation

This commit is contained in:
sabrina-shanman 2018-09-10 15:14:48 -07:00
parent 9a86b7451b
commit 3b7dac9058

View file

@ -349,12 +349,14 @@ public:
return !std::isnan(threshold) &&
!(glm::any(glm::isnan(transform.getTranslation())) ||
glm::any(glm::isnan(transform.getRotation())) ||
shapeInfo->getType() == SHAPE_TYPE_NONE);
shapeInfo->getType() == SHAPE_TYPE_NONE ||
collisionGroup == 0);
}
bool operator==(const CollisionRegion& other) const {
return loaded == other.loaded &&
threshold == other.threshold &&
collisionGroup == other.collisionGroup &&
glm::all(glm::equal(transform.getTranslation(), other.transform.getTranslation())) &&
glm::all(glm::equal(transform.getRotation(), other.transform.getRotation())) &&
glm::all(glm::equal(transform.getScale(), other.transform.getScale())) &&
@ -370,6 +372,10 @@ public:
return false;
}
if (collisionGroup == 0) {
return false;
}
return !shapeInfo->getPointCollection().size();
}