VR-Forces Development_Version Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
include
vrvDiGuy
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
8
class
diguyScenario;
9
10
// Now the OSG wrapper for the above OpenGL code, the most complicated bit is computing
11
// the bounding box for the above example, normally you'll find this the easy bit.
12
class
diguyOsgParticleRenderer
:
public
osg::Drawable
13
{
14
public
:
15
diguyOsgParticleRenderer
() :
m_scenario
(NULL){
16
;
17
}
18
diguyOsgParticleRenderer
(diguyScenario * scenario) :
m_scenario
(scenario)
19
{
20
setUseDisplayList(0);
21
setUseVertexBufferObjects(0);
22
m_state_set
=
new
osg::StateSet();
23
m_state
=
new
osg::State();
24
}
25
26
// the draw immediate mode method is where the OSG wraps up the drawing of
27
// of OpenGL primitives.
28
virtual
void
drawImplementation
(osg::RenderInfo& renderInfo)
const
;
29
30
31
// we need to set up the bounding box of the data too, so that the scene graph knows where this
32
// objects is, for both positioning the camera at start up, and most importantly for culling.
33
virtual
osg::BoundingBox
computeBound
()
const
;
34
35
static
osg::Geode*
createParticleRenderer
(diguyScenario * scenario);
36
37
// FIXME I have no idea how this works:
39
diguyOsgParticleRenderer
(
const
diguyOsgParticleRenderer
& teapot,
const
osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY):
40
osg::
Drawable
(teapot,copyop) {}
41
42
META_Object
(myTeapotApp,
diguyOsgParticleRenderer
)
43
44
45
46
protected:
47
48
virtual ~
diguyOsgParticleRenderer
() {}
49
50
diguyScenario *
m_scenario
;
51
osg::ref_ptr<osg::State>
m_state
;
52
osg::ref_ptr<osg::StateSet>
m_state_set
;
53
54
};
55
Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)