Explorar o código

Add applyQuaternion()

WestLangley %!s(int64=8) %!d(string=hai) anos
pai
achega
2f80668b30
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  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 ) {
 
 		// assumes axis is normalized
@@ -272,7 +280,7 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
 
 	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();