VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCubeModelInstance.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
13 
14 #include <osg/Geode>
15 #include <osg/MatrixTransform>
16 #include <osg/Drawable>
17 #include <osg/Material>
18 
19 namespace makVrv
20 {
24  {
25  public:
26 
29 
31  virtual ~DtCubeModelInstance();
32 
33  private:
34 
37 
40 
42  DtCubeModelInstance &operator=(const DtCubeModelInstance&);
43 
44  public:
45 
47  virtual void setDimensions(float x, float y, float z);
48 
50  void dimensions( float& length, float& width, float& height );
51 
53  virtual void setColor(float r,float g,float b,float a);
54 
56  const osg::Vec4& color() const;
57 
59  virtual void setLightingEnabled( bool enabled );
60 
64  virtual bool realize(DtModelDefinition& definition);
65 
67  virtual void setVisible(bool isVisible) {}
68 
70  virtual void setContributesToBound(bool trueOrFalse);
71 
72  protected:
73 
75  virtual void updateColors();
76 
78  virtual void updateTransform();
79 
81  void createBlendedGeodes();
82 
84  void createOpaqueGeode();
85 
87  void createSingleSidedBlendedGeode();
88 
89  protected:
90 
92  float myLength; // x dimension
93  float myWidth; // y dimension
94  float myHeight;
95  osg::Vec4 myColor;
96 
110 
112  };
113 
117  {
118  public:
119 
121  static void registerCreator(DtDe& de);
122 
124  virtual ~DtCubeModelInstanceCreator ();
125 
127  virtual DtModelInstance* create(DtDe& de);
128 
129  protected:
130 
132  };
133 }
The base class for all model instances.
Definition: DtModelInstance.h:39
osg::ref_ptr< osg::Drawable > myCubeDrawable
Definition: DtCubeModelInstance.h:97
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
osg::ref_ptr< osg::MatrixTransform > myTransform
My tranform.
Definition: DtCubeModelInstance.h:107
osg::ref_ptr< osg::Material > myMaterial
My Material.
Definition: DtCubeModelInstance.h:109
bool mySingleSided
Definition: DtCubeModelInstance.h:111
float myHeight
Definition: DtCubeModelInstance.h:94
A model definition Interaction any number of named parameters, and also can be used to store cached d...
Definition: DtModelDefinition.h:38
Contains makVrv::DtOsgModelInstance class.
Model instance to draw a cuboid.
Definition: DtCubeModelInstance.h:23
The base class for simple OSG based model instances. This call can&#39;t be instantiated itself...
Definition: DtOsgModelInstance.h:77
virtual void setVisible(bool isVisible)
no-op
Definition: DtCubeModelInstance.h:67
The polymorphic creator for the DtModelInstance.
Definition: DtModelInstance.h:148
osg::ref_ptr< osg::Geode > myBlendedGeode
Geode to draw the geometry when single-sided blending is required.
Definition: DtCubeModelInstance.h:101
osg::Vec4 myColor
Definition: DtCubeModelInstance.h:95
float myLength
The current parameter set.
Definition: DtCubeModelInstance.h:92
osg::ref_ptr< osg::Geode > myGeode
Geode to draw the geometry when no blending is required.
Definition: DtCubeModelInstance.h:99
float myWidth
Definition: DtCubeModelInstance.h:93
A Creator for the makVrv::DtAttachableCuboidModelInstance class.
Definition: DtCubeModelInstance.h:116
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:70
osg::ref_ptr< osg::Geode > myFrontGeode
Geode to draw the geometry with backface culling.
Definition: DtCubeModelInstance.h:103
osg::ref_ptr< osg::Geode > myBackGeode
Geode to draw the geometry with frontface culling.
Definition: DtCubeModelInstance.h:105

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)