Forráskód Böngészése

Merge pull request #7811 from bghgary/camera-fix

Use getAbsolutePosition to ensure world matrix is up-to-date
sebavan 5 éve
szülő
commit
f9803c03eb
1 módosított fájl, 2 hozzáadás és 2 törlés
  1. 2 2
      src/Meshes/transformNode.ts

+ 2 - 2
src/Meshes/transformNode.ts

@@ -1238,7 +1238,7 @@ export class TransformNode extends Node {
             camera = (<Camera>this.getScene().activeCamera);
         }
 
-        return Vector3.TransformCoordinates(this.absolutePosition, camera.getViewMatrix());
+        return Vector3.TransformCoordinates(this.getAbsolutePosition(), camera.getViewMatrix());
     }
 
     /**
@@ -1250,7 +1250,7 @@ export class TransformNode extends Node {
         if (!camera) {
             camera = (<Camera>this.getScene().activeCamera);
         }
-        return this.absolutePosition.subtract(camera.globalPosition).length();
+        return this.getAbsolutePosition().subtract(camera.globalPosition).length();
     }
 
     /**