|
@@ -105,6 +105,36 @@ THREE.Object3D.prototype = {
|
|
|
|
|
|
}(),
|
|
|
|
|
|
+ setRotationFromAxisAngle: function ( axis, angle ) {
|
|
|
+
|
|
|
+ // assumes axis is normalized
|
|
|
+
|
|
|
+ this.quaternion.setFromAxisAngle( axis, angle );
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ setRotationFromEuler: function ( euler ) {
|
|
|
+
|
|
|
+ this.quaternion.setFromEuler( euler, true );
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ setRotationFromMatrix: function ( m ) {
|
|
|
+
|
|
|
+ // assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)
|
|
|
+
|
|
|
+ this.quaternion.setFromRotationMatrix( m );
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ setRotationFromQuaternion: function ( q ) {
|
|
|
+
|
|
|
+ // assumes q is normalized
|
|
|
+
|
|
|
+ this.quaternion.copy( q );
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
rotateOnAxis: function() {
|
|
|
|
|
|
// rotate object on axis in object space
|