3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-27 01:15:36 +02:00

Add missing equality operator to CollisionRegion to fix false cache collisions leading to false negatives

This commit is contained in:
sabrina-shanman 2018-07-30 13:58:14 -07:00
parent de6d30e160
commit 6be5ac8dee

View file

@ -278,6 +278,14 @@ public:
shapeInfo.getType() == SHAPE_TYPE_NONE);
}
bool operator==(const CollisionRegion& other) const {
return 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())) &&
shapeInfo.getType() == other.shapeInfo.getType() &&
modelURL == other.modelURL;
}
bool shouldComputeShapeInfo() const {
if (!(shapeInfo.getType() == SHAPE_TYPE_HULL ||
(shapeInfo.getType() >= SHAPE_TYPE_COMPOUND &&