urdf-loader
Advanced tools
Comparing version 0.2.5 to 0.2.6
{ | ||
"name": "urdf-loader", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"description": "URDF Loader for THREE.js and webcomponent viewer", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -150,3 +150,3 @@ /* globals THREE URDFLoader */ | ||
dirLight.shadow.mapSize.height = 2048; | ||
dirLight.shadow.bias = -0.0001; | ||
dirLight.shadow.bias = -0.000025; | ||
dirLight.castShadow = true; | ||
@@ -366,3 +366,3 @@ scene.add(dirLight); | ||
this.plane.visible = this.displayShadow; | ||
this.directionalLight.castShadow = this.displayShadow; | ||
if (this.robot && this.displayShadow) { | ||
@@ -376,6 +376,15 @@ | ||
const minmax = bbox.getBoundingSphere(new THREE.Sphere()).radius; | ||
// Update the shadow camera rendering bounds to encapsulate the | ||
// model. We use the bounding sphere of the bounding box for | ||
// simplicity -- this could be a tighter fit. | ||
const sphere = bbox.getBoundingSphere(new THREE.Sphere()); | ||
const minmax = sphere.radius; | ||
const cam = this.directionalLight.shadow.camera; | ||
cam.left = cam.bottom = -minmax; | ||
cam.right = cam.top = minmax; | ||
// TODO: Position the camera about the center of the model | ||
// because it's possible that the model will be off center | ||
// and extend outside of the shadow camera bounds | ||
cam.updateProjectionMatrix(); | ||
@@ -464,3 +473,3 @@ | ||
return new THREE.MeshPhongMaterial(); | ||
m = new THREE.MeshPhongMaterial(); | ||
@@ -475,2 +484,4 @@ } | ||
m.shadowSide = THREE.DoubleSide; | ||
return m; | ||
@@ -485,3 +496,2 @@ | ||
}); | ||
@@ -488,0 +498,0 @@ done(mesh); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2578531
6661