VR-Forces 4.10 Class Documentation
 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) 2020 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 <osg/Geode>
17 #include <osg/Texture2DArray>
18 #include <osgUtil/RenderBin>
19 #include <vrvDiGuy/vrvDiGuy.h>
20 #include <diguyGraphicsInstanceGroup.h>
21 
22 namespace makVrv
23 {
24 
25  class DtGlTextureBufferObject;
26 
27  /*********************************************************************/
35 
37  {
38  public:
39  DtDiGuyOsgGraphicsInstanceGroup(void* internal_data);
41 
43  virtual void build();
45  virtual void unbuild();
47  virtual void update();
48 
50  virtual void setInDrawlistFlag();
52  virtual void clearInDrawlistFlag();
53 
56  inline bool isSkinnedModel() { return m_skinned_model; }
57  // performance critical stuff
58  inline bool hasTransparency() { return m_has_transparency == 1 ? 1 : 0; }
60  inline bool hasSpecMap() { return m_has_spec_map; }
62  inline bool hasEmatMap() { return m_has_emat_map; }
64  inline bool usePBR() { return m_pbr_enabled; }
66  inline int numLinks() { return m_num_links; }
67 
69  inline int startBaseOffset() { return m_start_base_offset; }
71  inline int startLinkOffset() { return m_start_link_offset; }
73  inline int numInstances() { return m_num_instances; }
74 
76  inline osg::Texture2D* diffuseTexture() { return m_diffuse_texture.get(); }
77  inline osg::Texture2D* normalTexture() { return m_normal_texture.get(); }
78  inline osg::Texture2D* componentTexture() { return m_component_texture.get(); }
79  inline osg::Texture2D* specTexture() { return m_spec_texture.get(); }
80  inline osg::Texture2DArray* sensorTexture() { return m_sensor_texture.get(); }
81 
83  inline osg::Geometry* geometry() { return m_geometry.get(); }
84 
86  inline osg::Geode * geode() { return m_geode.get(); }
87 
88 
89  protected:
90  // might be unneeded
94 
95 
96  // cached pointers for fast rendering
101  // sensorfx texture
103 
104  osg::Group *m_dofStateSetGroup;
106 
107  // cached uniform flag data
112 
115 
120 
122  bool m_in_list;
123 
124 
125  };
126 
128 };
129 
int m_num_links
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:116
diguyGraphicsInstanceGroup * diguyOsgGraphicsInstanceGroup_create_func(void *internal_data)
bool hasEmatMap()
has sensor texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:62
int startLinkOffset()
where the animation data starts
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:71
int numLinks()
how many joints object has
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:66
bool hasTransparency()
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:58
bool m_has_spec_map
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:109
bool m_skinned_model
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:108
osg::Texture2D * diffuseTexture()
returns various textures, not guaranteed not to be null
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:76
osg::ref_ptr< osg::Texture2D > m_component_texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:100
osg::ref_ptr< osg::Texture2DArray > m_sensor_texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:102
int m_start_link_offset
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:118
osg::ref_ptr< osg::PrimitiveSet > m_primitiveSet
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:93
Contains DLL export macros.
osg::Group * m_dofStateSetGroup
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:104
int startBaseOffset()
where the base matrix starts
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:69
bool m_statesetsDirty
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:105
osg::Texture2D * normalTexture()
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:77
osg::Texture2DArray * sensorTexture()
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:80
bool m_has_emat_map
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:111
int m_start_base_offset
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:117
bool m_pbr_enabled
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:110
bool m_in_list
in drawable list, possibly removable after diguy sdk upgrade
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:122
osg::ref_ptr< osg::Texture2D > m_diffuse_texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:97
osg::Geometry * geometry()
underlying geometry accessors
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:83
osg::Texture2D * specTexture()
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:79
int m_num_instances
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:119
bool usePBR()
interpret spec map with PBR path
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:64
bool isSkinnedModel()
stuff that doesn&#39;t change: for skinned uniform
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:56
Contains DLL export macros.
osg::ref_ptr< osg::Geode > m_geode
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:91
osg::ref_ptr< osg::Texture2D > m_spec_texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:99
#define DT_DLL_VRVDIGUY
Definition: vrvDiGuy.h:21
osg::Geode * geode()
underlying geode, needed for uniform setup currently
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:86
osg::ref_ptr< osg::Geometry > m_geometry
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:92
osg::Texture2D * componentTexture()
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:78
int m_has_transparency
int because starts at -1 so we know we still need to look it up
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:114
bool hasSpecMap()
has spec texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:60
osg::ref_ptr< osg::Texture2D > m_normal_texture
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:98
This class is part of the DI-Guy Graphics API.
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:36
int numInstances()
how many objects to draw.
Definition: DtDiGuyOsgGraphicsInstanceGroup.h:73

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)