DI-Guy SDK Documentation  13.5
diguyOsgParticleRenderer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <osg/Drawable>
4 #include <osg/Geode>
5 #include <osg/State>
6 #include <osg/StateSet>
7 #include <osg/MatrixTransform>
8 #include <osg/Version>
9 
10 class diguyScenario;
11 
17 class diguyOsgParticleRenderer : public osg::Drawable
18 {
19 public:
21  ;
22  }
24 
26  diguyOsgParticleRenderer(const diguyOsgParticleRenderer& teapot,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
27  osg::Drawable(teapot,copyop) {}
28 
29  META_Object(myTeapotApp,diguyOsgParticleRenderer)
30 
31 
32  // the draw immediate mode method is where the OSG wraps up the drawing of
33  // of OpenGL primitives.
34  virtual void drawImplementation(osg::RenderInfo& renderInfo) const;
35 
36 #if OSG_MIN_VERSION_REQUIRED(3,4,0)
37 
38  virtual osg::BoundingSphere computeBound() const;
39 #else
40  // we need to set up the bounding box of the data too, so that the scene graph knows where this
41  // objects is, for both positioning the camera at start up, and most importantly for culling.
42  virtual osg::BoundingBox computeBound() const;
43 #endif
44 
45  static osg::MatrixTransform* createParticleRenderer(diguyScenario * scenario);
46 
47 protected:
48 
49  virtual ~diguyOsgParticleRenderer() {}
50 
52  osg::ref_ptr<osg::MatrixTransform> m_base_transform;
53  osg::ref_ptr<osg::State> m_state;
54  osg::ref_ptr<osg::StateSet> m_state_set;
55 };
56 
static osg::MatrixTransform * createParticleRenderer(diguyScenario *scenario)
Definition: diguyOsgParticleRenderer.cpp:109
diguyOsgParticleRenderer()
Definition: diguyOsgParticleRenderer.h:20
diguyOsgParticleRenderer(const diguyOsgParticleRenderer &teapot, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
Definition: diguyOsgParticleRenderer.h:26
virtual ~diguyOsgParticleRenderer()
Definition: diguyOsgParticleRenderer.h:48
Represents the scenario currently being portrayed.
Definition: diguyScenario.h:100
diguyScenario * m_scenario
Definition: diguyOsgParticleRenderer.h:50
osg::ref_ptr< osg::State > m_state
Definition: diguyOsgParticleRenderer.h:52
osg::ref_ptr< osg::MatrixTransform > m_base_transform
Definition: diguyOsgParticleRenderer.h:51
osg::ref_ptr< osg::StateSet > m_state_set
Definition: diguyOsgParticleRenderer.h:53
Now the OSG wrapper for the OpenGL renderer code, the most complicated bit is computing the bounding ...
Definition: diguyOsgParticleRenderer.h:17
static diguyScenario * scenario
Definition: simple_playback_ogl.cpp:56