提交 0442b430 编写于 作者: S supereggbert

Add matrix calcs to direction shadow class

上级 2c4eb3b6
......@@ -5,7 +5,7 @@ import { OrthographicCamera } from '../cameras/OrthographicCamera.js';
* @author mrdoob / http://mrdoob.com/
*/
function DirectionalLightShadow( ) {
function DirectionalLightShadow() {
LightShadow.call( this, new OrthographicCamera( - 5, 5, 5, - 5, 0.5, 500 ) );
......@@ -13,7 +13,26 @@ function DirectionalLightShadow( ) {
DirectionalLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype ), {
constructor: DirectionalLightShadow
constructor: DirectionalLightShadow,
isDirectionalLightShadow: true,
updateMatrices: function ( light, viewCamera, viewportIndex ) {
var camera = this.camera,
lightPositionWorld = this._lightPositionWorld,
lookTarget = this._lookTarget;
lightPositionWorld.setFromMatrixPosition( light.matrixWorld );
camera.position.copy( lightPositionWorld );
lookTarget.setFromMatrixPosition( light.target.matrixWorld );
camera.lookAt( lookTarget );
camera.updateMatrixWorld();
LightShadow.prototype.updateMatrices.call( this, light, viewCamera, viewportIndex );
}
} );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册