OpenSceneGraph 3.6.5
ClusterCullingCallback
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
12*/
13
14#ifndef OSG_CLUSTERCULLINGCALLBACK
15#define OSG_CLUSTERCULLINGCALLBACK 1
16
17#include <osg/Drawable>
18#include <osg/Callback>
19
20namespace osg {
21
49{
50 public:
51
54 ClusterCullingCallback(const osg::Vec3& controlPoint, const osg::Vec3& normal, float deviation, float radius=-1.0f);
56
58
61
64
65 // use the NodeCallbacks implementation of run.
66 virtual bool run(osg::Object* object, osg::Object* data) { return NodeCallback::run(object, data); }
67
70 void computeFrom(const osg::Drawable* drawable);
71
73 void transform(const osg::Matrixd& matrix);
74
75 void set(const osg::Vec3& controlPoint, const osg::Vec3& normal, float deviation, float radius);
76
77 void setControlPoint(const osg::Vec3& controlPoint) { _controlPoint = controlPoint; }
78 const osg::Vec3& getControlPoint() const { return _controlPoint; }
79
80 void setNormal(const osg::Vec3& normal) { _normal = normal; }
81 const osg::Vec3& getNormal() const { return _normal; }
82
83 void setRadius(float radius) { _radius = radius; }
84 float getRadius() const { return _radius; }
85
86 void setDeviation(float deviation) { _deviation = deviation; }
87 float getDeviation() const { return _deviation; }
88
90
92 virtual void operator()(Node* node, NodeVisitor* nv);
93
94 protected:
95
97
100 float _radius;
102};
103
104
105}
106
107#endif
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Vec3f Vec3
Definition Vec3:21
virtual bool run(osg::Object *object, osg::Object *data)
NodeCallback overrides the Callback::run() method to adapt it the old style NodeCallback::operator()(...
NodeCallback()
Definition Callback:219
virtual NodeCallback * asNodeCallback()
Definition Callback:227
virtual DrawableCullCallback * asDrawableCullCallback()
Definition Callback:351
DrawableCullCallback()
Definition Callback:343
void setRadius(float radius)
Definition ClusterCullingCallback:83
float getRadius() const
Definition ClusterCullingCallback:84
ClusterCullingCallback(const osg::Vec3 &controlPoint, const osg::Vec3 &normal, float deviation, float radius=-1.0f)
virtual ~ClusterCullingCallback()
Definition ClusterCullingCallback:96
virtual DrawableCullCallback * asDrawableCullCallback()
Definition ClusterCullingCallback:62
virtual const NodeCallback * asNodeCallback() const
Definition ClusterCullingCallback:60
ClusterCullingCallback(const osg::Drawable *drawable)
void transform(const osg::Matrixd &matrix)
Transform the ClusterCullingCallback's positional members to a new coordinate frame.
void setControlPoint(const osg::Vec3 &controlPoint)
Definition ClusterCullingCallback:77
META_Object(osg, ClusterCullingCallback)
ClusterCullingCallback(const ClusterCullingCallback &ccc, const CopyOp &copyop)
const osg::Vec3 & getControlPoint() const
Definition ClusterCullingCallback:78
osg::Vec3 _normal
Definition ClusterCullingCallback:99
float _deviation
Definition ClusterCullingCallback:101
float _radius
Definition ClusterCullingCallback:100
virtual bool cull(osg::NodeVisitor *, osg::Drawable *, osg::State *) const
deprecated.
float getDeviation() const
Definition ClusterCullingCallback:87
osg::Vec3 _controlPoint
Definition ClusterCullingCallback:98
void computeFrom(const osg::Drawable *drawable)
Computes the control point, normal, and deviation from the given drawable contents.
void setNormal(const osg::Vec3 &normal)
Definition ClusterCullingCallback:80
virtual NodeCallback * asNodeCallback()
Definition ClusterCullingCallback:59
virtual bool run(osg::Object *object, osg::Object *data)
Invoke the callback, first parameter is the Object that the callback is attached to,...
Definition ClusterCullingCallback:66
const osg::Vec3 & getNormal() const
Definition ClusterCullingCallback:81
virtual void operator()(Node *node, NodeVisitor *nv)
Callback method called by the NodeVisitor when visiting a node.
void set(const osg::Vec3 &controlPoint, const osg::Vec3 &normal, float deviation, float radius)
virtual const DrawableCullCallback * asDrawableCullCallback() const
Definition ClusterCullingCallback:63
void setDeviation(float deviation)
Definition ClusterCullingCallback:86
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
Pure virtual base class for drawable geometry.
Definition Drawable:89
Definition Matrixd:27
Base class for all internal nodes in the scene graph.
Definition Node:72
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
#define OSG_EXPORT
Definition Export:39

osg logo
Generated at Wed Jul 23 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.