diff --git a/libraries/entities/src/EntityItem.cpp b/libraries/entities/src/EntityItem.cpp index fa9487c6f6..9012b2e50b 100644 --- a/libraries/entities/src/EntityItem.cpp +++ b/libraries/entities/src/EntityItem.cpp @@ -1021,18 +1021,7 @@ float EntityItem::getRadius() const { } void EntityItem::computeShapeInfo(ShapeInfo& info) const { - // HACK: Default first first approximation is to boxify the entity... but only if it is small enough. - // The limit here is chosen to something that most avatars could not comfortably fit inside - // to prevent houses from getting boxified... we don't want the things inside houses to - // collide with a house as if it were a giant solid block. - const float MAX_SIZE_FOR_BOXIFICATION_HACK = 3.0f; - float diagonal = glm::length(getDimensionsInMeters()); - if (diagonal < MAX_SIZE_FOR_BOXIFICATION_HACK) { - glm::vec3 halfExtents = 0.5f * getDimensionsInMeters(); - info.setBox(halfExtents); - } else { - info.clear(); - } + info.clear(); } void EntityItem::recalculateCollisionShape() { diff --git a/libraries/entities/src/ModelEntityItem.cpp b/libraries/entities/src/ModelEntityItem.cpp index 2c3dcd0600..bfab8871a5 100644 --- a/libraries/entities/src/ModelEntityItem.cpp +++ b/libraries/entities/src/ModelEntityItem.cpp @@ -245,6 +245,21 @@ bool ModelEntityItem::needsToCallUpdate() const { return isAnimatingSomething() ? true : EntityItem::needsToCallUpdate(); } +void ModelEntityItem::computeShapeInfo(ShapeInfo& info) const { + // HACK: Default first first approximation is to boxify the entity... but only if it is small enough. + // The limit here is chosen to something that most avatars could not comfortably fit inside + // to prevent houses from getting boxified... we don't want the things inside houses to + // collide with a house as if it were a giant solid block. + const float MAX_SIZE_FOR_BOXIFICATION_HACK = 3.0f; + float diagonal = glm::length(getDimensionsInMeters()); + if (diagonal < MAX_SIZE_FOR_BOXIFICATION_HACK) { + glm::vec3 halfExtents = 0.5f * getDimensionsInMeters(); + info.setBox(halfExtents); + } else { + info.clear(); + } +} + void ModelEntityItem::update(const quint64& now) { // only advance the frame index if we're playing if (getAnimationIsPlaying()) { diff --git a/libraries/entities/src/ModelEntityItem.h b/libraries/entities/src/ModelEntityItem.h index a607745475..3db2a40db0 100644 --- a/libraries/entities/src/ModelEntityItem.h +++ b/libraries/entities/src/ModelEntityItem.h @@ -46,6 +46,7 @@ public: virtual void update(const quint64& now); virtual bool needsToCallUpdate() const; + void computeShapeInfo(ShapeInfo& info) const; virtual void debugDump() const;