Borut 7 年之前
父节点
当前提交
11738bf8df
共有 2 个文件被更改,包括 4 次插入3 次删除
  1. 3 2
      src/Mesh/babylon.transformNode.ts
  2. 1 1
      what's new.md

+ 3 - 2
src/Mesh/babylon.transformNode.ts

@@ -8,6 +8,7 @@ module BABYLON {
         public static BILLBOARDMODE_ALL = 7;
         
         private _forward = new Vector3(0, 0, 1);
+        private _forwardInverted = new Vector3(0, 0, -1);
         private _up = new Vector3(0, 1, 0);
         private _right = new Vector3(1, 0, 0);
         private _rightInverted = new Vector3(-1, 0, 0);
@@ -121,7 +122,7 @@ module BABYLON {
          */
         public get forward(): Vector3 {
             return Vector3.Normalize(Vector3.TransformNormal(
-                this._forward,
+                this.getScene().useRightHandedSystem ? this._forwardInverted : this._forward,
                 this.getWorldMatrix()
             ));
         }
@@ -137,7 +138,7 @@ module BABYLON {
         }
 
         /**
-         * The up direction of that transform in world space.
+         * The right direction of that transform in world space.
          */
         public get right(): Vector3 {
             return Vector3.Normalize(Vector3.TransformNormal(

+ 1 - 1
what's new.md

@@ -66,7 +66,7 @@
 - Added scope option to Observerable ([adam](https://github.com/abow))
 - Added shadowBlur, shadowOffsetX, shadowOffsetY, shadowColor to GUI Controls ([adam](https://github.com/abow))
 - Added alignWithNormal to AbstractMesh ([adam](https://github.com/abow))
-- Added transformNode.forward/up/right ([adam](https://github.com/bobalazek))
+- Added transformNode.forward/up/right ([bobalazek](https://github.com/bobalazek))
 
 ## Bug fixes