|
@@ -112,12 +112,10 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
|
|
|
|
|
|
// rotate geometry around world x-axis
|
|
|
|
|
|
- var m1;
|
|
|
+ var m1 = new Matrix4();
|
|
|
|
|
|
return function rotateX( angle ) {
|
|
|
|
|
|
- if ( m1 === undefined ) m1 = new Matrix4();
|
|
|
-
|
|
|
m1.makeRotationX( angle );
|
|
|
|
|
|
this.applyMatrix( m1 );
|
|
@@ -132,12 +130,10 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
|
|
|
|
|
|
// rotate geometry around world y-axis
|
|
|
|
|
|
- var m1;
|
|
|
+ var m1 = new Matrix4();
|
|
|
|
|
|
return function rotateY( angle ) {
|
|
|
|
|
|
- if ( m1 === undefined ) m1 = new Matrix4();
|
|
|
-
|
|
|
m1.makeRotationY( angle );
|
|
|
|
|
|
this.applyMatrix( m1 );
|
|
@@ -152,12 +148,10 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
|
|
|
|
|
|
// rotate geometry around world z-axis
|
|
|
|
|
|
- var m1;
|
|
|
+ var m1 = new Matrix4();
|
|
|
|
|
|
return function rotateZ( angle ) {
|
|
|
|
|
|
- if ( m1 === undefined ) m1 = new Matrix4();
|
|
|
-
|
|
|
m1.makeRotationZ( angle );
|
|
|
|
|
|
this.applyMatrix( m1 );
|
|
@@ -172,12 +166,10 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
|
|
|
|
|
|
// translate geometry
|
|
|
|
|
|
- var m1;
|
|
|
+ var m1 = new Matrix4();
|
|
|
|
|
|
return function translate( x, y, z ) {
|
|
|
|
|
|
- if ( m1 === undefined ) m1 = new Matrix4();
|
|
|
-
|
|
|
m1.makeTranslation( x, y, z );
|
|
|
|
|
|
this.applyMatrix( m1 );
|
|
@@ -192,12 +184,10 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
|
|
|
|
|
|
// scale geometry
|
|
|
|
|
|
- var m1;
|
|
|
+ var m1 = new Matrix4();
|
|
|
|
|
|
return function scale( x, y, z ) {
|
|
|
|
|
|
- if ( m1 === undefined ) m1 = new Matrix4();
|
|
|
-
|
|
|
m1.makeScale( x, y, z );
|
|
|
|
|
|
this.applyMatrix( m1 );
|
|
@@ -210,12 +200,10 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
|
|
|
|
|
|
lookAt: function () {
|
|
|
|
|
|
- var obj;
|
|
|
+ var obj = new Object3D();
|
|
|
|
|
|
return function lookAt( vector ) {
|
|
|
|
|
|
- if ( obj === undefined ) obj = new Object3D();
|
|
|
-
|
|
|
obj.lookAt( vector );
|
|
|
|
|
|
obj.updateMatrix();
|