2012-03-22 01:36:20 +08:00
|
|
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2009 Robert Osfield
|
2009-01-14 01:20:32 +08:00
|
|
|
*
|
2012-03-22 01:36:20 +08:00
|
|
|
* 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
|
2009-01-14 01:20:32 +08:00
|
|
|
* (at your option) any later version. The full license is in LICENSE file
|
|
|
|
* included with this distribution, and on the openscenegraph.org website.
|
2012-03-22 01:36:20 +08:00
|
|
|
*
|
2009-01-14 01:20:32 +08:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2012-03-22 01:36:20 +08:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2009-01-14 01:20:32 +08:00
|
|
|
* OpenSceneGraph Public License for more details.
|
|
|
|
*/
|
|
|
|
|
2009-01-21 22:27:58 +08:00
|
|
|
#ifndef OSGVOLUME_RAYTRACEDTECHNIQUE
|
|
|
|
#define OSGVOLUME_RAYTRACEDTECHNIQUE 1
|
2009-01-14 01:20:32 +08:00
|
|
|
|
|
|
|
#include <osgVolume/VolumeTechnique>
|
2009-07-03 02:49:59 +08:00
|
|
|
#include <osg/MatrixTransform>
|
2009-01-14 01:20:32 +08:00
|
|
|
|
|
|
|
namespace osgVolume {
|
|
|
|
|
2009-01-21 22:27:58 +08:00
|
|
|
class OSGVOLUME_EXPORT RayTracedTechnique : public VolumeTechnique
|
2009-01-14 01:20:32 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
2009-01-21 22:27:58 +08:00
|
|
|
RayTracedTechnique();
|
2009-01-14 01:20:32 +08:00
|
|
|
|
2009-01-21 22:27:58 +08:00
|
|
|
RayTracedTechnique(const RayTracedTechnique&,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2009-01-21 22:27:58 +08:00
|
|
|
META_Object(osgVolume, RayTracedTechnique);
|
2009-01-14 01:20:32 +08:00
|
|
|
|
|
|
|
virtual void init();
|
|
|
|
|
|
|
|
virtual void update(osgUtil::UpdateVisitor* nv);
|
|
|
|
|
|
|
|
virtual void cull(osgUtil::CullVisitor* nv);
|
|
|
|
|
|
|
|
/** Clean scene graph from any terrain technique specific nodes.*/
|
|
|
|
virtual void cleanSceneGraph();
|
|
|
|
|
|
|
|
/** Traverse the terrain subgraph.*/
|
|
|
|
virtual void traverse(osg::NodeVisitor& nv);
|
|
|
|
|
|
|
|
protected:
|
2012-03-22 01:36:20 +08:00
|
|
|
|
2009-01-21 22:27:58 +08:00
|
|
|
virtual ~RayTracedTechnique();
|
2011-03-17 19:49:22 +08:00
|
|
|
|
2009-07-03 02:49:59 +08:00
|
|
|
osg::ref_ptr<osg::MatrixTransform> _transform;
|
2011-03-17 19:49:22 +08:00
|
|
|
|
2011-03-17 21:56:27 +08:00
|
|
|
typedef std::map<osgUtil::CullVisitor::Identifier*, osg::Matrix> ModelViewMatrixMap;
|
2011-03-17 19:49:22 +08:00
|
|
|
|
|
|
|
OpenThreads::Mutex _mutex;
|
|
|
|
ModelViewMatrixMap _modelViewMatrixMap;
|
|
|
|
|
2011-03-17 23:37:39 +08:00
|
|
|
osg::ref_ptr<osg::StateSet> _whenMovingStateSet;
|
2009-01-14 01:20:32 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|