/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ #include #include #include #include using namespace osgShadow; ShadowTechnique::CameraCullCallback::CameraCullCallback(ShadowTechnique* st): _shadowTechnique(st) { } void ShadowTechnique::CameraCullCallback::operator()(osg::Node*, osg::NodeVisitor* nv) { if (_shadowTechnique->getShadowedScene()) { _shadowTechnique->getShadowedScene()->osg::Group::traverse(*nv); } } ShadowTechnique::ShadowTechnique(): _shadowedScene(0), _dirty(true) { } ShadowTechnique::ShadowTechnique(const ShadowTechnique& copy, const osg::CopyOp& copyop): osg::Object(copy,copyop), _shadowedScene(0), _dirty(true) { } ShadowTechnique::~ShadowTechnique() { } void ShadowTechnique::init() { OSG_NOTICE<osg::Group::traverse(nv); } void ShadowTechnique::cull(osgUtil::CullVisitor& cv) { OSG_NOTICE<osg::Group::traverse(cv); } void ShadowTechnique::cleanSceneGraph() { OSG_NOTICE<osg::Group::traverse(nv); } else { _shadowedScene->osg::Group::traverse(nv); } } osg::Vec3 ShadowTechnique::computeOrthogonalVector(const osg::Vec3& direction) const { float length = direction.length(); osg::Vec3 orthogonalVector = direction ^ osg::Vec3(0.0f, 1.0f, 0.0f); if (orthogonalVector.normalize()