VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtDiGuyOsgGraphicsShape.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 
12 #include <vrvDiGuy/vrvDiGuy.h>
13 
14 #include <diguyGraphicsShape.h>
15 
16 #include <osg/Switch>
17 #include <osg/LOD>
18 #include <osg/Geode>
19 #include <osg/Texture2D>
20 
21 #include <osgEarth/ShaderUtils>
22 
23 struct FondDataWrapper;
24 
25 namespace makVrv
26 {
27  class DtDiGuyOsgTextureAttribute;
28  class DtDiGuyNameTextureDrawCallback;
29 
30 
35  {
37  osg::Matrixf m_offset;
38  };
39 
40 
44  {
45  public:
47  DtDiGuyOsgGraphicsShape( void* internal_data );
48 
50  virtual ~DtDiGuyOsgGraphicsShape();
51 
52  private:
56  DtDiGuyOsgGraphicsShape& operator=(const DtDiGuyOsgGraphicsShape&) = delete;
57 
58  public:
61  virtual void build() override;
62 
65  virtual void unbuild() override;
66 
69  virtual void show() override;
70 
73  virtual void hide() override;
74 
76  virtual void set_graphics_lod_ranges( float* lodRanges ) override;
77 
79  virtual void update_variation_texture( int num_pixels, unsigned char* pixel_data ) override;
80 
83  virtual void update() override;
84 
87  virtual void update_name_texture() override;
88 
92  virtual osg::Node* rootNode();
93 
95  virtual osg::StateSet* stateSet();
97  virtual osg::StateSet* parentStateSet();
98 
100  virtual void setAdditionalTboData(const std::vector<float>& tboData);
102  virtual const std::vector<float>& getAdditionalTboData();
103 
105  virtual bool getHasSwitches();
106 
108  virtual DtDiGuyOsgTextureAttribute* nameTexture();
109 
110  public:
111 
114 
116  static const osg::ref_ptr<osg::Texture2D>& getVariationTexture2D();
117 
118  static void releaseGLObjects();
119 
120  protected:
121 
124  virtual void create_name_texture();
125 
126  // this should probably be static
127  virtual void create_shared_variation_texture();
128  virtual void create_variation_texture( unsigned char* variation_texture_data );
129 
130  virtual osg::Geode* create_geode(const char* shape_set_name, bool flash);
131 
132  protected:
133 
134  std::vector<osg::ref_ptr<osg::Switch> > mySwitchNodeArray; // one per lod level
135 
147  std::vector<float> myAdditionalTboData;
148 
150 
151  std::vector<osg::Geode*> m_geodes;
152  diguyCharacter* myCharacter;
153 
155 
156  std::vector< diguyOsgMeshOffsets> m_offset_array;
157 
158  DtDiGuyOsgTextureAttribute* myNameTexture;
159 
160 
161  protected:
163  static bool UsePixelLods;
164 
166 
167  };
168 
169 }
170 
171 
osg::ref_ptr< osg::Uniform > myUniformDecalEnabled
Definition: DtDiGuyOsgGraphicsShape.h:142
osg::ref_ptr< osg::StateSet > myStateSet
Definition: DtDiGuyOsgGraphicsShape.h:137
osg::ref_ptr< osg::Uniform > myUniformLodFade
Definition: DtDiGuyOsgGraphicsShape.h:144
static osg::ref_ptr< osg::Texture2D > sm_variation_texture
Definition: DtDiGuyOsgGraphicsShape.h:165
std::vector< osg::Geode * > m_geodes
Definition: DtDiGuyOsgGraphicsShape.h:151
osg::ref_ptr< osg::Uniform > myUniformComponentMapRow
Definition: DtDiGuyOsgGraphicsShape.h:140
bool myNeedsTextureUpdate
Definition: DtDiGuyOsgGraphicsShape.h:154
osg::ref_ptr< osg::Uniform > myUniformBlendIndecies
Definition: DtDiGuyOsgGraphicsShape.h:146
osg::ref_ptr< osg::Uniform > myUniformLinkMatrix
Definition: DtDiGuyOsgGraphicsShape.h:138
DtDiGuyOsgTextureAttribute * myNameTexture
Definition: DtDiGuyOsgGraphicsShape.h:158
diguyGraphicsShape * diguyOsgGraphicsShape_create_func(void *internal_data)
Creator for VRV diguyGraphicsShape override.
Contains DLL export macros.
Definition: fond.h:371
static char * UniformLinkMatricesString
Static name of the bone uniform.
Definition: DtDiGuyOsgGraphicsShape.h:113
diguyCharacter * myCharacter
Definition: DtDiGuyOsgGraphicsShape.h:152
Override of diguyGraphicsShape to create OSG geometry for DI-Guy shapes.
Definition: DtDiGuyOsgGraphicsShape.h:43
osg::ref_ptr< osg::Uniform > myUniformLinkColor
Definition: DtDiGuyOsgGraphicsShape.h:136
osg::ref_ptr< osg::Uniform > m_ufrm_link_matrix
Definition: DtDiGuyOsgGraphicsShape.h:36
Helper struct for storing offsets for more complex meshes.
Definition: DtDiGuyOsgGraphicsShape.h:34
static bool UsePixelLods
Whether LOD calculations are based on distance from camera or pixel size in frame.
Definition: DtDiGuyOsgGraphicsShape.h:163
osg::ref_ptr< osg::Group > myGeodeGroup
Definition: DtDiGuyOsgGraphicsShape.h:149
std::vector< osg::ref_ptr< osg::Switch > > mySwitchNodeArray
Definition: DtDiGuyOsgGraphicsShape.h:134
osg::ref_ptr< osg::Uniform > myUniformPBRReady
Definition: DtDiGuyOsgGraphicsShape.h:141
osg::ref_ptr< osg::Uniform > myUniformLinkMatrices
Definition: DtDiGuyOsgGraphicsShape.h:139
std::vector< diguyOsgMeshOffsets > m_offset_array
Definition: DtDiGuyOsgGraphicsShape.h:156
#define DT_DLL_VRVDIGUY
Definition: vrvDiGuy.h:21
std::vector< float > myAdditionalTboData
Definition: DtDiGuyOsgGraphicsShape.h:147
osg::Matrixf m_offset
Definition: DtDiGuyOsgGraphicsShape.h:37
osg::ref_ptr< osg::Uniform > myUniformBlendWeights
Definition: DtDiGuyOsgGraphicsShape.h:145
osg::ref_ptr< osg::Uniform > myUniformDecalIndex
Definition: DtDiGuyOsgGraphicsShape.h:143
friend DtDiGuyNameTextureDrawCallback
Definition: DtDiGuyOsgGraphicsShape.h:122

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)