|
@@ -3194,7 +3194,7 @@ Object.assign( Vector3.prototype, {
|
|
|
|
|
|
},
|
|
|
|
|
|
- setFromCylindrical: function( c ) {
|
|
|
+ setFromCylindrical: function ( c ) {
|
|
|
|
|
|
this.x = c.radius * Math.sin( c.theta );
|
|
|
this.y = c.y;
|
|
@@ -3226,14 +3226,6 @@ Object.assign( Vector3.prototype, {
|
|
|
|
|
|
setFromMatrixColumn: function ( m, index ) {
|
|
|
|
|
|
- if ( typeof m === 'number' ) {
|
|
|
-
|
|
|
- console.warn( 'THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).' );
|
|
|
- var temp = m;
|
|
|
- m = index;
|
|
|
- index = temp;
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
return this.fromArray( m.elements, index * 4 );
|
|
|
|
|
@@ -8985,26 +8977,26 @@ Object.assign( Frustum.prototype, {
|
|
|
function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {
|
|
|
|
|
|
var _gl = _renderer.context,
|
|
|
- _state = _renderer.state,
|
|
|
- _frustum = new Frustum(),
|
|
|
- _projScreenMatrix = new Matrix4(),
|
|
|
+ _state = _renderer.state,
|
|
|
+ _frustum = new Frustum(),
|
|
|
+ _projScreenMatrix = new Matrix4(),
|
|
|
|
|
|
- _lightShadows = _lights.shadows,
|
|
|
+ _lightShadows = _lights.shadows,
|
|
|
|
|
|
- _shadowMapSize = new Vector2(),
|
|
|
- _maxShadowMapSize = new Vector2( capabilities.maxTextureSize, capabilities.maxTextureSize ),
|
|
|
+ _shadowMapSize = new Vector2(),
|
|
|
+ _maxShadowMapSize = new Vector2( capabilities.maxTextureSize, capabilities.maxTextureSize ),
|
|
|
|
|
|
- _lookTarget = new Vector3(),
|
|
|
- _lightPositionWorld = new Vector3(),
|
|
|
+ _lookTarget = new Vector3(),
|
|
|
+ _lightPositionWorld = new Vector3(),
|
|
|
|
|
|
- _MorphingFlag = 1,
|
|
|
+ _MorphingFlag = 1,
|
|
|
|
|
|
- _NumberOfMaterialVariants = ( _MorphingFlag ) + 1,
|
|
|
+ _NumberOfMaterialVariants = ( _MorphingFlag ) + 1,
|
|
|
|
|
|
- _depthMaterials = new Array( _NumberOfMaterialVariants ),
|
|
|
- _distanceMaterials = new Array( _NumberOfMaterialVariants ),
|
|
|
+ _depthMaterials = new Array( _NumberOfMaterialVariants ),
|
|
|
+ _distanceMaterials = new Array( _NumberOfMaterialVariants ),
|
|
|
|
|
|
- _materialCache = {};
|
|
|
+ _materialCache = {};
|
|
|
|
|
|
var cubeDirections = [
|
|
|
new Vector3( 1, 0, 0 ), new Vector3( - 1, 0, 0 ), new Vector3( 0, 0, 1 ),
|
|
@@ -9359,7 +9351,7 @@ function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {
|
|
|
|
|
|
if ( visible && ( object.isMesh || object.isLine || object.isPoints ) ) {
|
|
|
|
|
|
- if ( object.castShadow && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) {
|
|
|
+ if ( object.castShadow && ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) ) {
|
|
|
|
|
|
object.modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld );
|
|
|
|
|
@@ -9375,7 +9367,7 @@ function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {
|
|
|
var group = groups[ k ];
|
|
|
var groupMaterial = material[ group.materialIndex ];
|
|
|
|
|
|
- if ( groupMaterial && groupMaterial.visible === true ) {
|
|
|
+ if ( groupMaterial && groupMaterial.visible ) {
|
|
|
|
|
|
var depthMaterial = getDepthMaterial( object, groupMaterial, isPointLight, _lightPositionWorld );
|
|
|
_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, group );
|
|
@@ -9384,7 +9376,7 @@ function WebGLShadowMap( _renderer, _lights, _objects, capabilities ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- } else if ( material.visible === true ) {
|
|
|
+ } else if ( material.visible ) {
|
|
|
|
|
|
var depthMaterial = getDepthMaterial( object, material, isPointLight, _lightPositionWorld );
|
|
|
_renderer.renderBufferDirect( shadowCamera, null, geometry, depthMaterial, object, null );
|
|
@@ -10600,7 +10592,22 @@ Object.assign( Object3D.prototype, EventDispatcher.prototype, {
|
|
|
|
|
|
return function lookAt( vector ) {
|
|
|
|
|
|
- m1.lookAt( vector, this.position, this.up );
|
|
|
+ if ( this.position.distanceToSquared( vector ) === 0 ) {
|
|
|
+
|
|
|
+ console.warn( 'THREE.Object3D.lookAt(): target vector is the same as object position.' );
|
|
|
+ return;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if ( this.isCamera ) {
|
|
|
+
|
|
|
+ m1.lookAt( this.position, vector, this.up );
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ m1.lookAt( vector, this.position, this.up );
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
this.quaternion.setFromRotationMatrix( m1 );
|
|
|
|
|
@@ -15495,22 +15502,6 @@ Camera.prototype.getWorldDirection = function () {
|
|
|
|
|
|
}();
|
|
|
|
|
|
-Camera.prototype.lookAt = function () {
|
|
|
-
|
|
|
- // This routine does not support cameras with rotated and/or translated parent(s)
|
|
|
-
|
|
|
- var m1 = new Matrix4();
|
|
|
-
|
|
|
- return function lookAt( vector ) {
|
|
|
-
|
|
|
- m1.lookAt( this.position, vector, this.up );
|
|
|
-
|
|
|
- this.quaternion.setFromRotationMatrix( m1 );
|
|
|
-
|
|
|
- };
|
|
|
-
|
|
|
-}();
|
|
|
-
|
|
|
Camera.prototype.clone = function () {
|
|
|
|
|
|
return new this.constructor().copy( this );
|