|
@@ -1304,7 +1304,7 @@ THREE.WebGLRenderer = THREE.WebGLRenderer2 = function ( parameters ) {
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- _vector3.copy( object.matrixWorld.getPosition() );
|
|
|
+ _vector3.getPositionFromMatrix( object.matrixWorld );
|
|
|
_vector3.applyProjection(_projScreenMatrix);
|
|
|
|
|
|
webglObject.z = _vector3.z;
|
|
@@ -2507,8 +2507,8 @@ THREE.WebGLRenderer = THREE.WebGLRenderer2 = function ( parameters ) {
|
|
|
|
|
|
if ( p_uniforms.cameraPosition !== null ) {
|
|
|
|
|
|
- var position = camera.matrixWorld.getPosition();
|
|
|
- renderer.uniform3f( p_uniforms.cameraPosition, position.x, position.y, position.z );
|
|
|
+ _vector3.getPositionFromMatrix( camera.matrixWorld );
|
|
|
+ renderer.uniform3f( p_uniforms.cameraPosition, _vector3.x, _vector3.y, _vector3.z );
|
|
|
|
|
|
}
|
|
|
|
|
@@ -3109,8 +3109,9 @@ THREE.WebGLRenderer = THREE.WebGLRenderer2 = function ( parameters ) {
|
|
|
|
|
|
if ( ! light.visible ) continue;
|
|
|
|
|
|
- _direction.copy( light.matrixWorld.getPosition() );
|
|
|
- _direction.sub( light.target.matrixWorld.getPosition() );
|
|
|
+ _direction.getPositionFromMatrix( light.matrixWorld );
|
|
|
+ _vector3.getPositionFromMatrix( light.target.matrixWorld );
|
|
|
+ _direction.sub( _vector3 );
|
|
|
_direction.normalize();
|
|
|
|
|
|
// skip lights with undefined direction
|
|
@@ -3154,11 +3155,11 @@ THREE.WebGLRenderer = THREE.WebGLRenderer2 = function ( parameters ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- position = light.matrixWorld.getPosition();
|
|
|
+ _vector3.getPositionFromMatrix( light.matrixWorld );
|
|
|
|
|
|
- pointPositions[ pointOffset ] = position.x;
|
|
|
- pointPositions[ pointOffset + 1 ] = position.y;
|
|
|
- pointPositions[ pointOffset + 2 ] = position.z;
|
|
|
+ pointPositions[ pointOffset ] = _vector3.x;
|
|
|
+ pointPositions[ pointOffset + 1 ] = _vector3.y;
|
|
|
+ pointPositions[ pointOffset + 2 ] = _vector3.z;
|
|
|
|
|
|
pointDistances[ pointLength ] = distance;
|
|
|
|
|
@@ -3182,16 +3183,17 @@ THREE.WebGLRenderer = THREE.WebGLRenderer2 = function ( parameters ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- position = light.matrixWorld.getPosition();
|
|
|
+ _vector3.getPositionFromMatrix( light.matrixWorld );
|
|
|
|
|
|
- spotPositions[ spotOffset ] = position.x;
|
|
|
- spotPositions[ spotOffset + 1 ] = position.y;
|
|
|
- spotPositions[ spotOffset + 2 ] = position.z;
|
|
|
+ spotPositions[ spotOffset ] = _vector3.x;
|
|
|
+ spotPositions[ spotOffset + 1 ] = _vector3.y;
|
|
|
+ spotPositions[ spotOffset + 2 ] = _vector3.z;
|
|
|
|
|
|
spotDistances[ spotLength ] = distance;
|
|
|
|
|
|
- _direction.copy( position );
|
|
|
- _direction.sub( light.target.matrixWorld.getPosition() );
|
|
|
+ _direction.copy( _vector3 );
|
|
|
+ _vector3.getPositionFromMatrix( light.target.matrixWorld );
|
|
|
+ _direction.sub( _vector3 );
|
|
|
_direction.normalize();
|
|
|
|
|
|
spotDirections[ spotOffset ] = _direction.x;
|
|
@@ -3209,7 +3211,7 @@ THREE.WebGLRenderer = THREE.WebGLRenderer2 = function ( parameters ) {
|
|
|
|
|
|
if ( ! light.visible ) continue;
|
|
|
|
|
|
- _direction.copy( light.matrixWorld.getPosition() );
|
|
|
+ _direction.getPositionFromMatrix( light.matrixWorld );
|
|
|
_direction.normalize();
|
|
|
|
|
|
// skip lights with undefined direction
|