VR-Forces 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) 2023 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  class PrimitiveSet;
29  class Group;
30 }
31 
32 namespace makVrv
33 {
34  class DtGlTextureBufferObject;
35 
36  /*********************************************************************/
44 
46  {
47  public:
48  DtDiGuyOsgGraphicsInstanceGroup(void* internal_data);
50 
52  virtual void build();
54  virtual void unbuild();
56  virtual void update();
57 
59  virtual void setInDrawlistFlag();
61  virtual void clearInDrawlistFlag();
62 
65  inline bool isSkinnedModel() { return m_skinned_model; }
66  // performance critical stuff
67  inline bool hasTransparency() { return m_has_transparency == 1 ? 1 : 0; }
69  inline bool hasSpecMap() { return m_has_spec_map; }
71  inline bool hasEmatMap() { return m_has_emat_map; }
73  inline bool usePBR() { return m_pbr_enabled; }
75  inline int numLinks() { return m_num_links; }
76 
78  inline int startBaseOffset() { return m_start_base_offset; }
80  inline int startLinkOffset() { return m_start_link_offset; }
82  inline int numInstances() { return m_num_instances; }
83 
85  inline osg::Texture2D* diffuseTexture() { return m_diffuse_texture.get(); }
86  inline osg::Texture2D* normalTexture() { return m_normal_texture.get(); }
87  inline osg::Texture2D* componentTexture() { return m_component_texture.get(); }
88  inline osg::Texture2D* specTexture() { return m_spec_texture.get(); }
89  inline osg::Texture2DArray* sensorTexture() { return m_sensor_texture.get(); }
90 
92  inline osg::Geometry* geometry() { return m_geometry.get(); }
93 
95  inline osg::Geode * geode() { return m_geode.get(); }
96 
97 
98  protected:
99  // might be unneeded
103 
104 
105  // cached pointers for fast rendering
110  // sensorfx texture
112 
113  osg::Group* m_dofStateSetGroup;
115 
116  // cached uniform flag data
121 
124 
129 
131  bool m_in_list;
132 
133  };
134 
135 
137 
138 }
int m_num_links
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:125
diguyGraphicsInstanceGroup * diguyOsgGraphicsInstanceGroup_create_func(void *internal_data)
bool hasEmatMap()
has sensor texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:71
int startLinkOffset()
where the animation data starts
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:80
int numLinks()
how many joints object has
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:75
bool hasTransparency()
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:67
bool m_has_spec_map
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:118
bool m_skinned_model
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:117
osg::Texture2D * diffuseTexture()
returns various textures, not guaranteed not to be null
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:85
osg::ref_ptr< osg::Texture2D > m_component_texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:109
osg::ref_ptr< osg::Texture2DArray > m_sensor_texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:111
int m_start_link_offset
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:127
osg::ref_ptr< osg::PrimitiveSet > m_primitiveSet
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:102
Contains DLL export macros.
osg::Group * m_dofStateSetGroup
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:113
int startBaseOffset()
where the base matrix starts
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:78
bool m_statesetsDirty
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:114
osg::Texture2D * normalTexture()
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:86
osg::Texture2DArray * sensorTexture()
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:89
bool m_has_emat_map
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:120
int m_start_base_offset
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:126
bool m_pbr_enabled
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:119
bool m_in_list
in drawable list, possibly removable after diguy sdk upgrade
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:131
osg::ref_ptr< osg::Texture2D > m_diffuse_texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:106
osg::Geometry * geometry()
underlying geometry accessors
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:92
osg::Texture2D * specTexture()
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:88
int m_num_instances
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:128
bool usePBR()
interpret spec map with PBR path
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:73
bool isSkinnedModel()
stuff that doesn&#39;t change: for skinned uniform
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:65
Contains DLL export macros.
osg::ref_ptr< osg::Geode > m_geode
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:100
osg::ref_ptr< osg::Texture2D > m_spec_texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:108
#define DT_DLL_VRVDIGUY
Definition: vrvDiGuy.h:21
osg::Geode * geode()
underlying geode, needed for uniform setup currently
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:95
osg::ref_ptr< osg::Geometry > m_geometry
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:101
osg::Texture2D * componentTexture()
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:87
int m_has_transparency
int because starts at -1 so we know we still need to look it up
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:123
bool hasSpecMap()
has spec texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:69
osg::ref_ptr< osg::Texture2D > m_normal_texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:107
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:45
int numInstances()
how many objects to draw.
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:82

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)