mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 19:29:47 +02:00
Trying to notify the entity changes to the render item correctly, need more work
This commit is contained in:
parent
9326aebf20
commit
51bacdebdd
3 changed files with 11 additions and 3 deletions
|
@ -95,6 +95,7 @@ public: \
|
||||||
virtual bool addToScene(EntityItemPointer self, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges) override { return _renderHelper.addToScene(self, scene, pendingChanges); } \
|
virtual bool addToScene(EntityItemPointer self, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges) override { return _renderHelper.addToScene(self, scene, pendingChanges); } \
|
||||||
virtual void removeFromScene(EntityItemPointer self, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges) override { _renderHelper.removeFromScene(self, scene, pendingChanges); } \
|
virtual void removeFromScene(EntityItemPointer self, std::shared_ptr<render::Scene> scene, render::PendingChanges& pendingChanges) override { _renderHelper.removeFromScene(self, scene, pendingChanges); } \
|
||||||
virtual void locationChanged() override { EntityItem::locationChanged(); _renderHelper.notifyChanged(); } \
|
virtual void locationChanged() override { EntityItem::locationChanged(); _renderHelper.notifyChanged(); } \
|
||||||
|
virtual void dimensionsChanged() override { EntityItem::dimensionsChanged(); _renderHelper.notifyChanged(); } \
|
||||||
private: \
|
private: \
|
||||||
SimpleRenderableEntityItem _renderHelper;
|
SimpleRenderableEntityItem _renderHelper;
|
||||||
|
|
||||||
|
|
|
@ -1192,7 +1192,6 @@ void EntityItem::setDimensions(const glm::vec3& value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setScale(value);
|
setScale(value);
|
||||||
requiresRecalcBoxes();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The maximum bounding cube for the entity, independent of it's rotation.
|
/// The maximum bounding cube for the entity, independent of it's rotation.
|
||||||
|
@ -1916,3 +1915,8 @@ void EntityItem::locationChanged() {
|
||||||
requiresRecalcBoxes();
|
requiresRecalcBoxes();
|
||||||
SpatiallyNestable::locationChanged(); // tell all the children, also
|
SpatiallyNestable::locationChanged(); // tell all the children, also
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EntityItem::dimensionsChanged() {
|
||||||
|
requiresRecalcBoxes();
|
||||||
|
SpatiallyNestable::dimensionsChanged(); // Do what you have to do
|
||||||
|
}
|
||||||
|
|
|
@ -250,8 +250,9 @@ public:
|
||||||
const glm::vec3& getRegistrationPoint() const { return _registrationPoint; } /// registration point as ratio of entity
|
const glm::vec3& getRegistrationPoint() const { return _registrationPoint; } /// registration point as ratio of entity
|
||||||
|
|
||||||
/// registration point as ratio of entity
|
/// registration point as ratio of entity
|
||||||
void setRegistrationPoint(const glm::vec3& value)
|
void setRegistrationPoint(const glm::vec3& value) {
|
||||||
{ _registrationPoint = glm::clamp(value, 0.0f, 1.0f); requiresRecalcBoxes(); }
|
_registrationPoint = glm::clamp(value, 0.0f, 1.0f); dimensionsChanged(); // Registration Point affects the bounding box
|
||||||
|
}
|
||||||
|
|
||||||
bool hasAngularVelocity() const { return getAngularVelocity() != ENTITY_ITEM_ZERO_VEC3; }
|
bool hasAngularVelocity() const { return getAngularVelocity() != ENTITY_ITEM_ZERO_VEC3; }
|
||||||
|
|
||||||
|
@ -405,6 +406,8 @@ protected:
|
||||||
void setActionDataInternal(QByteArray actionData);
|
void setActionDataInternal(QByteArray actionData);
|
||||||
|
|
||||||
virtual void locationChanged() override;
|
virtual void locationChanged() override;
|
||||||
|
virtual void dimensionsChanged() override;
|
||||||
|
|
||||||
EntityTypes::EntityType _type;
|
EntityTypes::EntityType _type;
|
||||||
quint64 _lastSimulated; // last time this entity called simulate(), this includes velocity, angular velocity,
|
quint64 _lastSimulated; // last time this entity called simulate(), this includes velocity, angular velocity,
|
||||||
// and physics changes
|
// and physics changes
|
||||||
|
|
Loading…
Reference in a new issue