瀏覽代碼

Add applyQuaternion()

WestLangley 8 年之前
父節點
當前提交
2f80668b30
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      src/core/Object3D.js

+ 9 - 1
src/core/Object3D.js

@@ -112,6 +112,14 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
 
 
 	},
 	},
 
 
+	applyQuaternion: function ( q ) {
+
+		this.quaternion.premultiply( q );
+
+		return this;
+
+	},
+
 	setRotationFromAxisAngle: function ( axis, angle ) {
 	setRotationFromAxisAngle: function ( axis, angle ) {
 
 
 		// assumes axis is normalized
 		// assumes axis is normalized
@@ -272,7 +280,7 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
 
 
 	lookAt: function () {
 	lookAt: function () {
 
 
-		// This routine does not support objects with rotated and/or translated parent(s)
+		// This method does not support objects with rotated and/or translated parent(s)
 
 
 		var m1 = new Matrix4();
 		var m1 = new Matrix4();