VR-Forces 4.7 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
vrvOsg
DtCubeModelInstance.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2009 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
/******************************************************************************
6
** $RCSfile: DtAttachableCuboidModelInstance.h,v $ $Revision: 1.0 $ $State: Exp $
7
******************************************************************************/
8
12
13
#pragma once
14
#include <
vrvOsg/DtOsgModelInstance.h
>
15
#include <osg/Geode>
16
#include <osg/MatrixTransform>
17
#include <osg/Drawable>
18
#include <osg/Material>
19
20
namespace
makVrv
21
{
24
class
DT_DLL_VRVOSG
DtCubeModelInstance
:
public
DtOsgModelInstance
25
{
26
public
:
27
29
DtCubeModelInstance
(
DtDe
& de);
30
32
virtual
~
DtCubeModelInstance
();
33
35
virtual
void
setDimensions(
float
x,
float
y,
float
z);
36
38
void
dimensions(
float
& length,
float
& width,
float
& height );
39
41
virtual
void
setColor(
float
r,
float
g,
float
b,
float
a);
42
44
const
osg::Vec4& color()
const
;
45
47
virtual
void
setLightingEnabled(
bool
enabled );
48
51
virtual
bool
realize(
DtModelDefinition
& definition);
52
54
virtual
void
setVisible
(
bool
isVisible) {}
55
57
virtual
void
setContributesToBound(
bool
trueOrFalse);
58
59
protected
:
60
62
virtual
void
updateColors();
63
65
virtual
void
updateTransform();
66
68
void
createBlendedGeodes();
69
71
void
createOpaqueGeode();
72
74
void
createSingleSidedBlendedGeode();
75
76
protected
:
77
79
float
myLength
;
// x dimension
80
float
myWidth
;
// y dimension
81
float
myHeight
;
82
osg::Vec4
myColor
;
83
84
osg::ref_ptr<osg::Drawable>
myCubeDrawable
;
86
osg::ref_ptr<osg::Geode>
myGeode
;
88
osg::ref_ptr<osg::Geode>
myBlendedGeode
;
90
osg::ref_ptr<osg::Geode>
myFrontGeode
;
92
osg::ref_ptr<osg::Geode>
myBackGeode
;
94
osg::ref_ptr<osg::MatrixTransform>
myTransform
;
96
osg::ref_ptr<osg::Material>
myMaterial
;
97
98
bool
mySingleSided
;
99
};
100
103
class
DT_DLL_VRVOSG
DtCubeModelInstanceCreator
:
public
DtModelInstanceCreator
104
{
105
public
:
106
108
static
void
registerCreator(
DtDe
& de);
109
111
virtual
~
DtCubeModelInstanceCreator
();
112
114
virtual
DtModelInstance
* create(
DtDe
& de);
115
116
protected
:
117
118
DtCubeModelInstanceCreator
();
119
};
120
}
Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (
www.mak.com
)