From c765a35650027967fd6a94d431d92ef05f697173 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 5 Mar 2010 16:17:12 +0000 Subject: [PATCH] From Wojcoech Lewandowski, "Attched are aimShadowCastingCamera() call changes, I have described in former post. Basically now MinimalShadowMap overrides first variant and keeps second. So both variants of aimShadowCastingCamera are clearly defined in MinimalShadowMap::ViewData scope. This way compilers have no problem and code looks less obscure. Changes made against the trunk." --- include/osgShadow/MinimalShadowMap | 7 +++++++ src/osgShadow/MinimalShadowMap.cpp | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/include/osgShadow/MinimalShadowMap b/include/osgShadow/MinimalShadowMap index 810a3cf83..9a9963cf3 100644 --- a/include/osgShadow/MinimalShadowMap +++ b/include/osgShadow/MinimalShadowMap @@ -114,6 +114,13 @@ class OSGSHADOW_EXPORT MinimalShadowMap : public StandardShadowMap virtual void cullShadowReceivingScene( ); + virtual void aimShadowCastingCamera( + const osg::BoundingSphere &bounds, + const osg::Light *light, + const osg::Vec4 &worldLightPos, + const osg::Vec3 &worldLightDir, + const osg::Vec3 &worldLightUp = osg::Vec3(0,1,0) ); + virtual void aimShadowCastingCamera( const osg::Light *light, const osg::Vec4 &worldLightPos, const osg::Vec3 &worldLightDir, diff --git a/src/osgShadow/MinimalShadowMap.cpp b/src/osgShadow/MinimalShadowMap.cpp index b0716c559..78c77fab8 100644 --- a/src/osgShadow/MinimalShadowMap.cpp +++ b/src/osgShadow/MinimalShadowMap.cpp @@ -114,6 +114,17 @@ osg::BoundingBox MinimalShadowMap::ViewData::computeShadowReceivingCoarseBounds( return osg::BoundingBox(); } +void MinimalShadowMap::ViewData::aimShadowCastingCamera( + const osg::BoundingSphere &bs, + const osg::Light *light, + const osg::Vec4 &lightPos, + const osg::Vec3 &lightDir, + const osg::Vec3 &lightUpVector + /* by default = osg::Vec3( 0, 1 0 )*/ ) +{ + BaseClass::ViewData::aimShadowCastingCamera( bs, light, lightPos, lightDir, lightUpVector ); +} + void MinimalShadowMap::ViewData::aimShadowCastingCamera ( const osg::Light *light, const osg::Vec4 &lightPos, const osg::Vec3 &lightDir, const osg::Vec3 &lightUp ) @@ -148,8 +159,7 @@ void MinimalShadowMap::ViewData::aimShadowCastingCamera #endif } - BaseClass::ViewData::aimShadowCastingCamera - ( bb, light, lightPos, lightDir, up ); + aimShadowCastingCamera( osg::BoundingSphere( bb ), light, lightPos, lightDir, up ); // Intersect scene Receiving Shadow Polytope with shadow camera frustum // Important for cases where Scene extend beyond shadow camera frustum