Sfoglia il codice sorgente

Fix incorrect transform of decal normals when decal is not in same node as target geometry. Closes #1618.

Lasse Öörni 9 anni fa
parent
commit
174e555303
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      Source/Urho3D/Graphics/DecalSet.cpp

+ 1 - 1
Source/Urho3D/Graphics/DecalSet.cpp

@@ -969,7 +969,7 @@ void DecalSet::TransformVertices(Decal& decal, const Matrix3x4& transform)
     for (PODVector<DecalVertex>::Iterator i = decal.vertices_.Begin(); i != decal.vertices_.End(); ++i)
     {
         i->position_ = transform * i->position_;
-        i->normal_ = (transform * i->normal_).Normalized();
+        i->normal_ = (transform * Vector4(i->normal_, 0.0f)).Normalized();
     }
 }