mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 06:58:56 +02:00
fix transform properties not changing
This commit is contained in:
parent
6bf1545285
commit
3e3bd2ffd8
1 changed files with 4 additions and 5 deletions
|
@ -26,7 +26,6 @@ bool MaterialEntityRenderer::needsRenderUpdate() const {
|
||||||
|
|
||||||
bool MaterialEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityPointer& entity) const {
|
bool MaterialEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityPointer& entity) const {
|
||||||
if (resultWithReadLock<bool>([&] {
|
if (resultWithReadLock<bool>([&] {
|
||||||
// Won't cause material re-apply
|
|
||||||
if (entity->getMaterialMappingMode() != _materialMappingMode) {
|
if (entity->getMaterialMappingMode() != _materialMappingMode) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +42,6 @@ bool MaterialEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityP
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Could require material re-apply
|
|
||||||
if (entity->getMaterialURL() != _materialURL) {
|
if (entity->getMaterialURL() != _materialURL) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -69,6 +67,8 @@ bool MaterialEntityRenderer::needsRenderUpdateFromTypedEntity(const TypedEntityP
|
||||||
|
|
||||||
void MaterialEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) {
|
void MaterialEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPointer& entity) {
|
||||||
withWriteLock([&] {
|
withWriteLock([&] {
|
||||||
|
bool deleteNeeded = false;
|
||||||
|
bool addNeeded = _retryApply;
|
||||||
bool transformChanged = false;
|
bool transformChanged = false;
|
||||||
{
|
{
|
||||||
MaterialMappingMode mode = entity->getMaterialMappingMode();
|
MaterialMappingMode mode = entity->getMaterialMappingMode();
|
||||||
|
@ -109,14 +109,13 @@ void MaterialEntityRenderer::doRenderUpdateAsynchronousTyped(const TypedEntityPo
|
||||||
auto material = getMaterial();
|
auto material = getMaterial();
|
||||||
// Update the old material regardless of if it's going to change
|
// Update the old material regardless of if it's going to change
|
||||||
if (transformChanged && material && !_parentID.isNull()) {
|
if (transformChanged && material && !_parentID.isNull()) {
|
||||||
|
deleteNeeded = true;
|
||||||
|
addNeeded = true;
|
||||||
applyTextureTransform(material);
|
applyTextureTransform(material);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool deleteNeeded = false;
|
|
||||||
bool addNeeded = _retryApply;
|
|
||||||
bool urlChanged = false;
|
bool urlChanged = false;
|
||||||
|
|
||||||
std::string newCurrentMaterialName = _currentMaterialName;
|
std::string newCurrentMaterialName = _currentMaterialName;
|
||||||
{
|
{
|
||||||
QString materialURL = entity->getMaterialURL();
|
QString materialURL = entity->getMaterialURL();
|
||||||
|
|
Loading…
Reference in a new issue