VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtDiGuyOsgGraphicsInstanceGroup.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <osg/Version>
13 
14 #include <vrvOsg/vrvOsg.h>
15 
16 #include <vrvDiGuy/vrvDiGuy.h>
17 
18 #include <diguyGraphicsInstanceGroup.h>
19 
20 #include <osg/ref_ptr>
21 
22 namespace osg
23 {
24  class Texture2D;
25  class Texture2DArray;
26  class Geode;
27  class Geometry;
28 }
29 
30 namespace makVrv
31 {
32 
33  class DtGlTextureBufferObject;
34 
35  /*********************************************************************/
43 
45  {
46  public:
47  DtDiGuyOsgGraphicsInstanceGroup(void* internal_data);
49 
51  virtual void build();
53  virtual void unbuild();
55  virtual void update();
56 
58  virtual void setInDrawlistFlag();
60  virtual void clearInDrawlistFlag();
61 
64  inline bool isSkinnedModel() { return m_skinned_model; }
65  // performance critical stuff
66  inline bool hasTransparency() { return m_has_transparency == 1 ? 1 : 0; }
68  inline bool hasSpecMap() { return m_has_spec_map; }
70  inline bool hasEmatMap() { return m_has_emat_map; }
72  inline bool usePBR() { return m_pbr_enabled; }
74  inline int numLinks() { return m_num_links; }
75 
77  inline int startBaseOffset() { return m_start_base_offset; }
79  inline int startLinkOffset() { return m_start_link_offset; }
81  inline int numInstances() { return m_num_instances; }
82 
84  inline osg::Texture2D* diffuseTexture() { return m_diffuse_texture.get(); }
85  inline osg::Texture2D* normalTexture() { return m_normal_texture.get(); }
86  inline osg::Texture2D* componentTexture() { return m_component_texture.get(); }
87  inline osg::Texture2D* specTexture() { return m_spec_texture.get(); }
88  inline osg::Texture2DArray* sensorTexture() { return m_sensor_texture.get(); }
89 
91  inline osg::Geometry* geometry() { return m_geometry.get(); }
92 
94  inline osg::Geode * geode() { return m_geode.get(); }
95 
96 
97  protected:
98  // might be unneeded
102 
103 
104  // cached pointers for fast rendering
109  // sensorfx texture
111 
112  osg::Group *m_dofStateSetGroup;
114 
115  // cached uniform flag data
120 
123 
128 
130  bool m_in_list;
131  };
132 
134 };
135 
int m_num_links
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:124
diguyGraphicsInstanceGroup * diguyOsgGraphicsInstanceGroup_create_func(void *internal_data)
bool hasEmatMap()
has sensor texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:70
int startLinkOffset()
where the animation data starts
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:79
int numLinks()
how many joints object has
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:74
bool hasTransparency()
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:66
bool m_has_spec_map
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:117
bool m_skinned_model
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:116
osg::Texture2D * diffuseTexture()
returns various textures, not guaranteed not to be null
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:84
osg::ref_ptr< osg::Texture2D > m_component_texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:108
osg::ref_ptr< osg::Texture2DArray > m_sensor_texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:110
int m_start_link_offset
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:126
osg::ref_ptr< osg::PrimitiveSet > m_primitiveSet
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:101
Contains DLL export macros.
osg::Group * m_dofStateSetGroup
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:112
int startBaseOffset()
where the base matrix starts
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:77
bool m_statesetsDirty
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:113
osg::Texture2D * normalTexture()
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:85
osg::Texture2DArray * sensorTexture()
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:88
bool m_has_emat_map
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:119
int m_start_base_offset
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:125
bool m_pbr_enabled
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:118
bool m_in_list
in drawable list, possibly removable after diguy sdk upgrade
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:130
osg::ref_ptr< osg::Texture2D > m_diffuse_texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:105
osg::Geometry * geometry()
underlying geometry accessors
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:91
osg::Texture2D * specTexture()
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:87
int m_num_instances
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:127
bool usePBR()
interpret spec map with PBR path
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:72
bool isSkinnedModel()
stuff that doesn&#39;t change: for skinned uniform
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:64
Contains DLL export macros.
osg::ref_ptr< osg::Geode > m_geode
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:99
osg::ref_ptr< osg::Texture2D > m_spec_texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:107
#define DT_DLL_VRVDIGUY
Definition: vrvDiGuy.h:21
osg::Geode * geode()
underlying geode, needed for uniform setup currently
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:94
osg::ref_ptr< osg::Geometry > m_geometry
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:100
osg::Texture2D * componentTexture()
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:86
int m_has_transparency
int because starts at -1 so we know we still need to look it up
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:122
bool hasSpecMap()
has spec texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:68
osg::ref_ptr< osg::Texture2D > m_normal_texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:106
This class is part of the DI-Guy Graphics API. It overrides the class diguyGraphicsInstanceGroup. Detailed documentation is in the implementation file documentation here.
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:44
int numInstances()
how many objects to draw.
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:81

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)