Browse Source

Fix getDistance to camera when there is a parent

David Catuhe 6 years ago
parent
commit
9b549ceda6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Meshes/transformNode.ts

+ 1 - 1
src/Meshes/transformNode.ts

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