提交 27dbc1f6 编写于 作者: J Joe Fox

Revert "Improve Geometry closure performance"

This reverts commit 083e99f2.
上级 82fb5c80
......@@ -110,10 +110,12 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
// rotate geometry around world x-axis
var m1 = new Matrix4();
var m1;
return function rotateX( angle ) {
if ( m1 === undefined ) m1 = new Matrix4();
m1.makeRotationX( angle );
this.applyMatrix( m1 );
......@@ -128,10 +130,12 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
// rotate geometry around world y-axis
var m1 = new Matrix4();
var m1;
return function rotateY( angle ) {
if ( m1 === undefined ) m1 = new Matrix4();
m1.makeRotationY( angle );
this.applyMatrix( m1 );
......@@ -146,10 +150,12 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
// rotate geometry around world z-axis
var m1 = new Matrix4();
var m1;
return function rotateZ( angle ) {
if ( m1 === undefined ) m1 = new Matrix4();
m1.makeRotationZ( angle );
this.applyMatrix( m1 );
......@@ -164,10 +170,12 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
// translate geometry
var m1 = new Matrix4();
var m1;
return function translate( x, y, z ) {
if ( m1 === undefined ) m1 = new Matrix4();
m1.makeTranslation( x, y, z );
this.applyMatrix( m1 );
......@@ -182,10 +190,12 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
// scale geometry
var m1 = new Matrix4();
var m1;
return function scale( x, y, z ) {
if ( m1 === undefined ) m1 = new Matrix4();
m1.makeScale( x, y, z );
this.applyMatrix( m1 );
......@@ -198,10 +208,12 @@ Object.assign( Geometry.prototype, EventDispatcher.prototype, {
lookAt: function () {
var obj = new Object3D();
var obj;
return function lookAt( vector ) {
if ( obj === undefined ) obj = new Object3D();
obj.lookAt( vector );
obj.updateMatrix();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册