浏览代码

Quaternion toArray(): return array; fix property names

Alexander Rose 10 年之前
父节点
当前提交
df724c6b5b
共有 1 个文件被更改,包括 7 次插入5 次删除
  1. 7 5
      src/math/Quaternion.js

+ 7 - 5
src/math/Quaternion.js

@@ -489,14 +489,16 @@ THREE.Quaternion.prototype = {
 
 
 			if ( offset === undefined ) offset = 0;
 			if ( offset === undefined ) offset = 0;
 
 
-			array[ offset ] = this.x;
-			array[ offset + 1 ] = this.y;
-			array[ offset + 2 ] = this.z;
-			array[ offset + 3 ] = this.w;
+			array[ offset ] = this._x;
+			array[ offset + 1 ] = this._y;
+			array[ offset + 2 ] = this._z;
+			array[ offset + 3 ] = this._w;
+			
+			return array;
 
 
 		} else {
 		} else {
 
 
-			return [ this.x, this.y, this.z, this.w ];
+			return [ this._x, this._y, this._z, this._w ];
 
 
 		}
 		}