ClusterCullingCallback
Go to the documentation of this file.
/* -*-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.
*/
#ifndef OSG_CLUSTERCULLINGCALLBACK
#define OSG_CLUSTERCULLINGCALLBACK 1
#include <osg/Drawable>
#include <osg/Callback>
namespace osg {
class OSG_EXPORT ClusterCullingCallback : public DrawableCullCallback, public NodeCallback
{
public:
ClusterCullingCallback();
ClusterCullingCallback(const ClusterCullingCallback& ccc,const CopyOp& copyop);
ClusterCullingCallback(const osg::Vec3& controlPoint, const osg::Vec3& normal, float deviation, float radius=-1.0f);
ClusterCullingCallback(const osg::Drawable* drawable);
META_Object(osg,ClusterCullingCallback);
virtual NodeCallback* asNodeCallback() { return osg::NodeCallback::asNodeCallback(); }
virtual const NodeCallback* asNodeCallback() const { return osg::NodeCallback::asNodeCallback(); }
virtual DrawableCullCallback* asDrawableCullCallback() { return osg::DrawableCullCallback::asDrawableCullCallback(); }
virtual const DrawableCullCallback* asDrawableCullCallback() const { return osg::DrawableCullCallback::asDrawableCullCallback(); }
// use the NodeCallbacks implementation of run.
virtual bool run(osg::Object* object, osg::Object* data) { return NodeCallback::run(object, data); }
void computeFrom(const osg::Drawable* drawable);
void transform(const osg::Matrixd& matrix);
void set(const osg::Vec3& controlPoint, const osg::Vec3& normal, float deviation, float radius);
void setControlPoint(const osg::Vec3& controlPoint) { _controlPoint = controlPoint; }
const osg::Vec3& getControlPoint() const { return _controlPoint; }
void setNormal(const osg::Vec3& normal) { _normal = normal; }
const osg::Vec3& getNormal() const { return _normal; }
void setRadius(float radius) { _radius = radius; }
float getRadius() const { return _radius; }
void setDeviation(float deviation) { _deviation = deviation; }
float getDeviation() const { return _deviation; }
virtual bool cull(osg::NodeVisitor*, osg::Drawable*, osg::State*) const;
virtual void operator()(Node* node, NodeVisitor* nv);
protected:
virtual ~ClusterCullingCallback() {}
osg::Vec3 _controlPoint;
osg::Vec3 _normal;
float _radius;
float _deviation;
};
}
#endif
Callback
Drawable
osg::ClusterCullingCallback::setRadius
void setRadius(float radius)
Definition ClusterCullingCallback:83
osg::ClusterCullingCallback::getRadius
float getRadius() const
Definition ClusterCullingCallback:84
osg::ClusterCullingCallback::ClusterCullingCallback
ClusterCullingCallback(const osg::Vec3 &controlPoint, const osg::Vec3 &normal, float deviation, float radius=-1.0f)
osg::ClusterCullingCallback::~ClusterCullingCallback
virtual ~ClusterCullingCallback()
Definition ClusterCullingCallback:96
osg::ClusterCullingCallback::asDrawableCullCallback
virtual DrawableCullCallback * asDrawableCullCallback()
Definition ClusterCullingCallback:62
osg::ClusterCullingCallback::asNodeCallback
virtual const NodeCallback * asNodeCallback() const
Definition ClusterCullingCallback:60
osg::ClusterCullingCallback::ClusterCullingCallback
ClusterCullingCallback(const osg::Drawable *drawable)
osg::ClusterCullingCallback::transform
void transform(const osg::Matrixd &matrix)
osg::ClusterCullingCallback::setControlPoint
void setControlPoint(const osg::Vec3 &controlPoint)
Definition ClusterCullingCallback:77
osg::ClusterCullingCallback::META_Object
META_Object(osg, ClusterCullingCallback)
osg::ClusterCullingCallback::ClusterCullingCallback
ClusterCullingCallback(const ClusterCullingCallback &ccc, const CopyOp &copyop)
osg::ClusterCullingCallback::getControlPoint
const osg::Vec3 & getControlPoint() const
Definition ClusterCullingCallback:78
osg::ClusterCullingCallback::_normal
osg::Vec3 _normal
Definition ClusterCullingCallback:99
osg::ClusterCullingCallback::_deviation
float _deviation
Definition ClusterCullingCallback:101
osg::ClusterCullingCallback::_radius
float _radius
Definition ClusterCullingCallback:100
osg::ClusterCullingCallback::cull
virtual bool cull(osg::NodeVisitor *, osg::Drawable *, osg::State *) const
osg::ClusterCullingCallback::getDeviation
float getDeviation() const
Definition ClusterCullingCallback:87
osg::ClusterCullingCallback::_controlPoint
osg::Vec3 _controlPoint
Definition ClusterCullingCallback:98
osg::ClusterCullingCallback::computeFrom
void computeFrom(const osg::Drawable *drawable)
osg::ClusterCullingCallback::ClusterCullingCallback
ClusterCullingCallback()
osg::ClusterCullingCallback::setNormal
void setNormal(const osg::Vec3 &normal)
Definition ClusterCullingCallback:80
osg::ClusterCullingCallback::asNodeCallback
virtual NodeCallback * asNodeCallback()
Definition ClusterCullingCallback:59
osg::ClusterCullingCallback::run
virtual bool run(osg::Object *object, osg::Object *data)
Definition ClusterCullingCallback:66
osg::ClusterCullingCallback::getNormal
const osg::Vec3 & getNormal() const
Definition ClusterCullingCallback:81
osg::ClusterCullingCallback::operator()
virtual void operator()(Node *node, NodeVisitor *nv)
osg::ClusterCullingCallback::set
void set(const osg::Vec3 &controlPoint, const osg::Vec3 &normal, float deviation, float radius)
osg::ClusterCullingCallback::asDrawableCullCallback
virtual const DrawableCullCallback * asDrawableCullCallback() const
Definition ClusterCullingCallback:63
osg::ClusterCullingCallback::setDeviation
void setDeviation(float deviation)
Definition ClusterCullingCallback:86
osg::CopyOp
Definition CopyOp:41
osg::DrawableCullCallback::asDrawableCullCallback
virtual DrawableCullCallback * asDrawableCullCallback()
Definition Callback:351
osg::DrawableCullCallback::DrawableCullCallback
DrawableCullCallback()
Definition Callback:343
osg::Drawable
Definition Drawable:89
osg::Matrixd
Definition Matrixd:27
osg::NodeCallback::run
virtual bool run(osg::Object *object, osg::Object *data)
osg::NodeCallback::NodeCallback
NodeCallback()
Definition Callback:219
osg::NodeCallback::asNodeCallback
virtual NodeCallback * asNodeCallback()
Definition Callback:227
osg::NodeVisitor
Definition NodeVisitor:82
osg::Node
Definition Node:72
osg::Object
Definition Object:61
osg::State
Definition State:80
osg
Definition AlphaFunc:19
osg::Vec3
Vec3f Vec3
Definition Vec3:21
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39