|
@@ -170,6 +170,26 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
|
|
|
|
|
|
}(),
|
|
|
|
|
|
+ rotateOnWorldAxis: function () {
|
|
|
+
|
|
|
+ // rotate object on axis in world space
|
|
|
+ // axis is assumed to be normalized
|
|
|
+ // method assumes no rotated parent
|
|
|
+
|
|
|
+ var q1 = new Quaternion();
|
|
|
+
|
|
|
+ return function rotateOnWorldAxis(axis, angle) {
|
|
|
+
|
|
|
+ q1.setFromAxisAngle(axis, angle);
|
|
|
+
|
|
|
+ this.quaternion.premultiply(q1);
|
|
|
+
|
|
|
+ return this;
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ }(),
|
|
|
+
|
|
|
rotateX: function () {
|
|
|
|
|
|
var v1 = new Vector3( 1, 0, 0 );
|