DI-Guy SDK Documentation  13.7.1
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 
30 
31  // the draw immediate mode method is where the OSG wraps up the drawing of
32  // of OpenGL primitives.
33  virtual void drawImplementation(osg::RenderInfo& renderInfo) const override;
34 
35 #if OSG_MIN_VERSION_REQUIRED(3,4,0)
36 
37  virtual osg::BoundingSphere computeBound() const;
38 #else
39  // we need to set up the bounding box of the data too, so that the scene graph knows where this
40  // objects is, for both positioning the camera at start up, and most importantly for culling.
41  virtual osg::BoundingBox computeBound() const;
42 #endif
43 
44  static osg::MatrixTransform* createParticleRenderer(diguyScenario * scenario);
45 
46 protected:
47 
49 
51  osg::ref_ptr<osg::MatrixTransform> m_base_transform;
52  osg::ref_ptr<osg::State> m_state;
53  osg::ref_ptr<osg::StateSet> m_state_set;
54 };
55 
static osg::MatrixTransform * createParticleRenderer(diguyScenario *scenario)
Definition: diguyOsgParticleRenderer.cpp:109
diguyOsgParticleRenderer()
Definition: diguyOsgParticleRenderer.h:20
virtual void drawImplementation(osg::RenderInfo &renderInfo) const override
Definition: diguyOsgParticleRenderer.cpp:130
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:99
diguyScenario * m_scenario
Definition: diguyOsgParticleRenderer.h:50
virtual osg::BoundingBox computeBound() const
Definition: diguyOsgParticleRenderer.cpp:179
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
META_Object(myTeapotApp, diguyOsgParticleRenderer)
static diguyScenario * scenario
Definition: simple_playback_ogl.cpp:59