Sfoglia il codice sorgente

Check determinant sign for instances

Cedric Guillemet 5 anni fa
parent
commit
f7dbdc31df
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      src/Meshes/instancedMesh.ts

+ 2 - 2
src/Meshes/instancedMesh.ts

@@ -286,8 +286,8 @@ export class InstancedMesh extends AbstractMesh {
         }
         }
 
 
         if (this._currentLOD) {
         if (this._currentLOD) {
-
-            if (this._currentLOD._getWorldMatrixDeterminant() !== this._getWorldMatrixDeterminant()) {
+            let differentSign = (this._currentLOD._getWorldMatrixDeterminant() > 0) !== (this._getWorldMatrixDeterminant() > 0);
+            if (differentSign) {
                 this._internalAbstractMeshDataInfo._actAsRegularMesh = true;
                 this._internalAbstractMeshDataInfo._actAsRegularMesh = true;
                 return true;
                 return true;
             }
             }