DI-Guy SDK Documentation  13.8
diguyOsgParticleRenderer.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2024 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
6 #pragma once
7 
8 #include <osg/Drawable>
9 #include <osg/Geode>
10 #include <osg/State>
11 #include <osg/StateSet>
12 #include <osg/MatrixTransform>
13 #include <osg/Version>
14 
15 class diguyScenario;
16 
22 class diguyOsgParticleRenderer : public osg::Drawable
23 {
24 public:
26  ;
27  }
29 
31  diguyOsgParticleRenderer(const diguyOsgParticleRenderer& teapot,const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
32  osg::Drawable(teapot,copyop) {}
33 
35 
36  // the draw immediate mode method is where the OSG wraps up the drawing of
37  // of OpenGL primitives.
38  virtual void drawImplementation(osg::RenderInfo& renderInfo) const override;
39 
40 #if OSG_MIN_VERSION_REQUIRED(3,4,0)
41 
42  virtual osg::BoundingSphere computeBound() const;
43 #else
44  // we need to set up the bounding box of the data too, so that the scene graph knows where this
45  // objects is, for both positioning the camera at start up, and most importantly for culling.
46  virtual osg::BoundingBox computeBound() const;
47 #endif
48 
49  static osg::MatrixTransform* createParticleRenderer(diguyScenario * scenario);
50 
51 protected:
52 
54 
56  osg::ref_ptr<osg::MatrixTransform> m_base_transform;
57  osg::ref_ptr<osg::State> m_state;
58  osg::ref_ptr<osg::StateSet> m_state_set;
59 };
60 
virtual osg::BoundingBox computeBound() const
virtual void drawImplementation(osg::RenderInfo &renderInfo) const override
diguyOsgParticleRenderer()
Definition: diguyOsgParticleRenderer.h:25
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:31
virtual ~diguyOsgParticleRenderer()
Definition: diguyOsgParticleRenderer.h:53
Represents the scenario currently being portrayed.
Definition: diguyScenario.h:99
diguyScenario * m_scenario
Definition: diguyOsgParticleRenderer.h:55
osg::ref_ptr< osg::State > m_state
Definition: diguyOsgParticleRenderer.h:57
static osg::MatrixTransform * createParticleRenderer(diguyScenario *scenario)
osg::ref_ptr< osg::MatrixTransform > m_base_transform
Definition: diguyOsgParticleRenderer.h:56
osg::ref_ptr< osg::StateSet > m_state_set
Definition: diguyOsgParticleRenderer.h:58
Now the OSG wrapper for the OpenGL renderer code, the most complicated bit is computing the bounding ...
Definition: diguyOsgParticleRenderer.h:22
META_Object(myTeapotApp, diguyOsgParticleRenderer)