Changeset 10935
- Timestamp:
- 01/08/10 12:37:35 (3 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgShadow/StandardShadowMap.cpp
r10699 r10935 678 678 if( light->getSpotCutoff() < 180.0f) // spotlight, no need for bounding box 679 679 { 680 osg::Vec3 position(lightPos.x(), lightPos.y(), lightPos.z());680 osg::Vec3d position(lightPos.x(), lightPos.y(), lightPos.z()); 681 681 float spotAngle = light->getSpotCutoff(); 682 682 … … 688 688 if (lightPos[3]!=0.0) // point light 689 689 { 690 osg::Vec3 position(lightPos.x(), lightPos.y(), lightPos.z());690 osg::Vec3d position(lightPos.x(), lightPos.y(), lightPos.z()); 691 691 692 692 float centerDistance = (position-bs.center()).length(); … … 695 695 float zfar = centerDistance+bs.radius(); 696 696 float zNearRatio = 0.001f; 697 if (znear<zfar*zNearRatio) znear = zfar*zNearRatio; 697 if (znear<zfar*zNearRatio) 698 znear = zfar*zNearRatio; 698 699 699 700 float top = (bs.radius()/centerDistance)*znear; … … 709 710 // set the position far away along the light direction 710 711 float radius = bs.radius(); 711 osg::Vec3 position = bs.center() - lightDir * radius * 2;712 osg::Vec3d position = bs.center() - lightDir * radius * 2; 712 713 713 714 float centerDistance = (position-bs.center()).length();
