Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
86 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import THREE from 'three'; | ||
import * as THREE from 'three'; | ||
|
||
export default { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,50 @@ | ||
module.exports = [ | ||
'shadowCameraNear', | ||
'shadowCameraFar', | ||
|
||
|
||
const shadowPropNames = [ | ||
// 'shadowCameraNear', // moved | ||
// 'shadowCameraFar', // moved | ||
'shadowCameraVisible', | ||
'shadowBias', | ||
'shadowDarkness', | ||
'shadowMapWidth', | ||
'shadowMapHeight', | ||
// 'shadowBias', // kmoved | ||
// 'shadowDarkness', // removed | ||
// 'shadowMapWidth', // moved | ||
// 'shadowMapHeight', // moved | ||
'shadowMap', | ||
'shadowMapSize', | ||
// 'shadowMapSize', // moved? did this ever exist? | ||
'shadowCamera', | ||
'shadowMatrix' | ||
]; | ||
|
||
export default function tranferCommonShadowmapProps(THREEObject3D, newProps) | ||
{ | ||
if (typeof THREEObject3D.shadow === 'undefined') { | ||
// ??? issue a warning? | ||
return; | ||
} | ||
|
||
// props that reference inner object values | ||
if (typeof newProps.shadowBias !== 'undefined') { | ||
THREEObject3D.shadow.bias = newProps.shadowBias; | ||
} | ||
if (typeof newProps.shadowMapWidth !== 'undefined') { | ||
THREEObject3D.shadow.mapSize.width = newProps.shadowMapWidth; | ||
} | ||
if (typeof newProps.shadowMapHeight !== 'undefined') { | ||
THREEObject3D.shadow.mapSize.height = newProps.shadowMapHeight; | ||
} | ||
if (typeof newProps.shadowCameraFar !== 'undefined') { | ||
THREEObject3D.shadow.camera.far = newProps.shadowCameraFar; | ||
} | ||
if (typeof newProps.shadowCameraNear !== 'undefined') { | ||
THREEObject3D.shadow.camera.near = newProps.shadowCameraNear; | ||
} | ||
if (typeof newProps.shadowCameraFov !== 'undefined') { | ||
THREEObject3D.shadow.camera.fov = newProps.shadowCameraFov; | ||
} | ||
|
||
// normal props we can transfer by name | ||
shadowPropNames.forEach(function(propname) { | ||
if (typeof newProps[propname] !== 'undefined') { | ||
THREEObject3D[propname] = newProps[propname]; | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters