mirror of
https://github.com/overte-org/overte.git
synced 2025-04-10 08:56:57 +02:00
cleanup EntityItem::shouldBePhysical() and derivations
This commit is contained in:
parent
8445eaf310
commit
7dfa8a26a3
7 changed files with 9 additions and 18 deletions
|
@ -735,13 +735,15 @@ bool RenderableModelEntityItem::shouldBePhysical() const {
|
|||
auto model = getModel();
|
||||
// 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 (model && (getShapeType() == SHAPE_TYPE_COMPOUND || getShapeType() == SHAPE_TYPE_SIMPLE_COMPOUND) && model->didCollisionGeometryRequestFail()) {
|
||||
return false;
|
||||
} else if (model && getShapeType() != SHAPE_TYPE_NONE && model->didVisualGeometryRequestFail()) {
|
||||
return false;
|
||||
} else {
|
||||
return ModelEntityItem::shouldBePhysical();
|
||||
ShapeType shapeType = getShapeType();
|
||||
if (model) {
|
||||
if ((shapeType == SHAPE_TYPE_COMPOUND || shapeType == SHAPE_TYPE_SIMPLE_COMPOUND) && model->didCollisionGeometryRequestFail()) {
|
||||
return false;
|
||||
} else if (shapeType != SHAPE_TYPE_NONE && model->didVisualGeometryRequestFail()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return !isDead() && shapeType != SHAPE_TYPE_NONE && QUrl(_modelURL).isValid();
|
||||
}
|
||||
|
||||
int RenderableModelEntityItem::getJointParent(int index) const {
|
||||
|
|
|
@ -72,7 +72,6 @@ public:
|
|||
glm::mat4 localToVoxelMatrix() const;
|
||||
|
||||
virtual ShapeType getShapeType() const override;
|
||||
virtual bool shouldBePhysical() const override { return !isDead(); }
|
||||
virtual bool isReadyToComputeShape() const override;
|
||||
virtual void computeShapeInfo(ShapeInfo& info) override;
|
||||
|
||||
|
|
|
@ -322,7 +322,7 @@ public:
|
|||
bool getDynamic() const;
|
||||
void setDynamic(bool value);
|
||||
|
||||
virtual bool shouldBePhysical() const { return false; }
|
||||
virtual bool shouldBePhysical() const { return !isDead(); }
|
||||
bool isVisuallyReady() const { return _visuallyReady; }
|
||||
|
||||
bool getLocked() const;
|
||||
|
|
|
@ -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) {
|
||||
if (newSize < 0) {
|
||||
return;
|
||||
|
|
|
@ -118,8 +118,6 @@ public:
|
|||
const QString getTextures() const;
|
||||
void setTextures(const QString& textures);
|
||||
|
||||
virtual bool shouldBePhysical() const override;
|
||||
|
||||
virtual void setJointRotations(const QVector<glm::quat>& rotations);
|
||||
virtual void setJointRotationsSet(const QVector<bool>& rotationsSet);
|
||||
virtual void setJointTranslations(const QVector<glm::vec3>& translations);
|
||||
|
|
|
@ -164,7 +164,6 @@ class PolyVoxEntityItem : public EntityItem {
|
|||
glm::vec3 getSurfacePositionAdjustment() const;
|
||||
|
||||
virtual ShapeType getShapeType() const override;
|
||||
virtual bool shouldBePhysical() const override { return !isDead(); }
|
||||
|
||||
bool isEdged() const;
|
||||
|
||||
|
|
|
@ -84,8 +84,6 @@ public:
|
|||
|
||||
void setUnscaledDimensions(const glm::vec3& value) override;
|
||||
|
||||
bool shouldBePhysical() const override { return !isDead(); }
|
||||
|
||||
bool supportsDetailedIntersection() const override;
|
||||
bool findDetailedRayIntersection(const glm::vec3& origin, const glm::vec3& direction,
|
||||
OctreeElementPointer& element, float& distance,
|
||||
|
|
Loading…
Reference in a new issue