cleanup EntityItem::shouldBePhysical() and derivations

This commit is contained in:
Andrew Meadows 2019-04-17 14:58:38 -07:00
parent 8445eaf310
commit 7dfa8a26a3
7 changed files with 9 additions and 18 deletions

View file

@ -735,13 +735,15 @@ bool RenderableModelEntityItem::shouldBePhysical() const {
auto model = getModel(); auto model = getModel();
// If we have a model, make sure it hasn't failed to download. // If we have a model, make sure it hasn't failed to download.
// If it has, we'll report back that we shouldn't be physical so that physics aren't held waiting for us to be ready. // If it has, we'll report back that we shouldn't be physical so that physics aren't held waiting for us to be ready.
if (model && (getShapeType() == SHAPE_TYPE_COMPOUND || getShapeType() == SHAPE_TYPE_SIMPLE_COMPOUND) && model->didCollisionGeometryRequestFail()) { ShapeType shapeType = getShapeType();
return false; if (model) {
} else if (model && getShapeType() != SHAPE_TYPE_NONE && model->didVisualGeometryRequestFail()) { if ((shapeType == SHAPE_TYPE_COMPOUND || shapeType == SHAPE_TYPE_SIMPLE_COMPOUND) && model->didCollisionGeometryRequestFail()) {
return false; return false;
} else { } else if (shapeType != SHAPE_TYPE_NONE && model->didVisualGeometryRequestFail()) {
return ModelEntityItem::shouldBePhysical(); return false;
}
} }
return !isDead() && shapeType != SHAPE_TYPE_NONE && QUrl(_modelURL).isValid();
} }
int RenderableModelEntityItem::getJointParent(int index) const { int RenderableModelEntityItem::getJointParent(int index) const {

View file

@ -72,7 +72,6 @@ public:
glm::mat4 localToVoxelMatrix() const; glm::mat4 localToVoxelMatrix() const;
virtual ShapeType getShapeType() const override; virtual ShapeType getShapeType() const override;
virtual bool shouldBePhysical() const override { return !isDead(); }
virtual bool isReadyToComputeShape() const override; virtual bool isReadyToComputeShape() const override;
virtual void computeShapeInfo(ShapeInfo& info) override; virtual void computeShapeInfo(ShapeInfo& info) override;

View file

@ -322,7 +322,7 @@ public:
bool getDynamic() const; bool getDynamic() const;
void setDynamic(bool value); void setDynamic(bool value);
virtual bool shouldBePhysical() const { return false; } virtual bool shouldBePhysical() const { return !isDead(); }
bool isVisuallyReady() const { return _visuallyReady; } bool isVisuallyReady() const { return _visuallyReady; }
bool getLocked() const; bool getLocked() const;

View file

@ -421,11 +421,6 @@ void ModelEntityItem::setAnimationFPS(float value) {
}); });
} }
// virtual
bool ModelEntityItem::shouldBePhysical() const {
return !isDead() && getShapeType() != SHAPE_TYPE_NONE && QUrl(_modelURL).isValid();
}
void ModelEntityItem::resizeJointArrays(int newSize) { void ModelEntityItem::resizeJointArrays(int newSize) {
if (newSize < 0) { if (newSize < 0) {
return; return;

View file

@ -118,8 +118,6 @@ public:
const QString getTextures() const; const QString getTextures() const;
void setTextures(const QString& textures); void setTextures(const QString& textures);
virtual bool shouldBePhysical() const override;
virtual void setJointRotations(const QVector<glm::quat>& rotations); virtual void setJointRotations(const QVector<glm::quat>& rotations);
virtual void setJointRotationsSet(const QVector<bool>& rotationsSet); virtual void setJointRotationsSet(const QVector<bool>& rotationsSet);
virtual void setJointTranslations(const QVector<glm::vec3>& translations); virtual void setJointTranslations(const QVector<glm::vec3>& translations);

View file

@ -164,7 +164,6 @@ class PolyVoxEntityItem : public EntityItem {
glm::vec3 getSurfacePositionAdjustment() const; glm::vec3 getSurfacePositionAdjustment() const;
virtual ShapeType getShapeType() const override; virtual ShapeType getShapeType() const override;
virtual bool shouldBePhysical() const override { return !isDead(); }
bool isEdged() const; bool isEdged() const;

View file

@ -84,8 +84,6 @@ public:
void setUnscaledDimensions(const glm::vec3& value) override; void setUnscaledDimensions(const glm::vec3& value) override;
bool shouldBePhysical() const override { return !isDead(); }
bool supportsDetailedIntersection() const override; bool supportsDetailedIntersection() const override;
bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction, bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
OctreeElementPointer& element, float& distance, OctreeElementPointer& element, float& distance,