mirror of
https://github.com/overte-org/overte.git
synced 2025-04-09 13:02:24 +02:00
small fixes
This commit is contained in:
parent
115229da92
commit
f413ad3312
4 changed files with 20 additions and 3 deletions
|
@ -302,10 +302,23 @@ void RenderableModelEntityItem::setShapeType(ShapeType type) {
|
|||
void RenderableModelEntityItem::setCompoundShapeURL(const QString& url) {
|
||||
auto currentCompoundShapeURL = getCompoundShapeURL();
|
||||
ModelEntityItem::setCompoundShapeURL(url);
|
||||
if (getCompoundShapeURL() != currentCompoundShapeURL || !getModel()) {
|
||||
if (getCompoundShapeURL() != currentCompoundShapeURL) {
|
||||
auto shapeType = getShapeType();
|
||||
if (shapeType == SHAPE_TYPE_COMPOUND || shapeType == SHAPE_TYPE_SIMPLE_COMPOUND) {
|
||||
fetchCollisionGeometryResource();
|
||||
markDirtyFlags(Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RenderableModelEntityItem::setModelURL(const QString& url) {
|
||||
auto currentModelURL = getModelURL();
|
||||
ModelEntityItem::setModelURL(url);
|
||||
if (getModelURL() != currentModelURL) {
|
||||
auto shapeType = getShapeType();
|
||||
if (shapeType == SHAPE_TYPE_COMPOUND || shapeType == SHAPE_TYPE_SIMPLE_COMPOUND) {
|
||||
fetchCollisionGeometryResource();
|
||||
markDirtyFlags(Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,6 +76,7 @@ public:
|
|||
|
||||
virtual void setShapeType(ShapeType type) override;
|
||||
virtual void setCompoundShapeURL(const QString& url) override;
|
||||
virtual void setModelURL(const QString& url) override;
|
||||
|
||||
virtual bool isReadyToComputeShape() const override;
|
||||
virtual void computeShapeInfo(ShapeInfo& shapeInfo) override;
|
||||
|
|
|
@ -199,7 +199,11 @@ void ZoneEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointe
|
|||
auto visible = entity->getVisible();
|
||||
if (transformChanged || visible != _lastVisible) {
|
||||
_lastVisible = visible;
|
||||
DependencyManager::get<EntityTreeRenderer>()->updateZone(entity->getID());
|
||||
void* key = (void*)this;
|
||||
EntityItemID id = entity->getID();
|
||||
AbstractViewStateInterface::instance()->pushPostUpdateLambda(key, [id] {
|
||||
DependencyManager::get<EntityTreeRenderer>()->updateZone(id);
|
||||
});
|
||||
}
|
||||
|
||||
auto proceduralUserData = entity->getUserData();
|
||||
|
|
|
@ -324,7 +324,6 @@ void ModelEntityItem::setCompoundShapeURL(const QString& url) {
|
|||
withWriteLock([&] {
|
||||
if (_compoundShapeURL.get() != url) {
|
||||
_compoundShapeURL.set(url);
|
||||
_flags |= Simulation::DIRTY_SHAPE | Simulation::DIRTY_MASS;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue