23 #include <matrix/vlVector.h>
25 #include <osgUtil/LineSegmentIntersector>
26 #include <osgViewer/Renderer>
28 #include <osg/ref_ptr>
29 #include <osg/LightSource>
31 #include <boost/unordered_map.hpp>
32 #include <tbb/cache_aligned_allocator.h>
33 #include <tbb/atomic.h>
34 #include <tbb/spin_rw_mutex.h>
35 #include <tbb/concurrent_queue.h>
58 class DtGlTextureBufferObject;
59 class DtInstanceProcessor;
60 class DtInstanceLpProcessor;
61 class DtOsgIntersectorResult;
62 class DtChannelManager;
64 class DtPerViewUniformCallback;
67 class DtOsgCullVisitorParameters;
68 class DtViewSpecificGroup;
69 class DtInstanceManagerTboUpdater;
78 typedef std::vector<osg::ref_ptr<osg::Geometry> >
GeometryVec;
82 typedef std::vector<osg::ref_ptr<osgEarth::VirtualProgram> >
VpRefList;
88 static const unsigned int NumVec4PerInstance = 8;
162 InstancedDof() : numChildren(0), myAnimatedMatrix(NULL), skipNextAnimationFrame(false) { ; }
247 LightSource() : attachDrawableIx(0), range(0), isRangeScheme(false) { ; }
285 typedef std::vector<InstancedLod*>
LodVec;
293 : myAnimatedNodeCount(0)
294 , boundingRadius(0.0f)
295 , intersectionBoundingRadius(0.0f)
297 , daylightControlledLights(false)
403 bool intersect(
const osg::Vec3d& start,
const osg::Vec3d& end,
405 std::list<DtUniqueID>* ignoreList = 0);
408 bool intersect(
const osg::Vec3d& start,
const osg::Vec3d& end,
409 std::vector<DtOsgIntersectorResult>& results,
410 std::list<DtUniqueID>* ignoreList = 0);
417 void setSequenceSpeed(
const DtInstanceState& instance,
unsigned int sequenceIndex,
float speed);
420 void setSequencePlayTime(
const DtInstanceState& instance,
unsigned int sequenceIndex,
float loopTime);
433 void setDofAnimation(osg::Vec3f& hpr,
const osg::Vec3f& hprVel,
const DtInstanceState& state,
unsigned int partIndex);
436 void setDofRotationalVelocity(
const osg::Vec3f& hprVel,
const DtInstanceState& state,
unsigned int partIndex,
bool forceUpdate =
true);
439 void setDofTranslation(osg::Vec3f& trans, osg::Vec3f& transVel,
const DtInstanceState& state,
unsigned int partIndex);
444 void setSwitchState(
const DtInstanceState& instance,
unsigned int partIndex,
unsigned int childIndex,
bool state);
449 void setUVOffset(
DtUniqueID id,
unsigned int drawableIx,
unsigned int count,
const osg::Vec2f& uvOffset);
454 void setUserDefined(
DtUniqueID id,
float userDefined);
459 void setLightpointRange(
DtUniqueID id,
float range);
466 osg::StateSet* getModelTypeRootStateSet(
const std::string& modelType);
480 virtual void reset();
483 virtual osg::Node* instanceRoot();
486 bool isRegistered(
const std::string& modelType);
489 void registerModel(
const std::string& modelType,
const ParserOutput& parseOutput,
490 float boundingRadius,
const DtVector& boundingCenter,
494 osg::Geode* setupModelGeode(
const std::string& modelType,
unsigned int nodeMask);
497 void allocateImage(
const osg::View* view);
503 void drainFreeInstanceList();
505 void setArtPartSmoothingEnabled(
bool onOrOff);
506 bool artPartSmoothingEnabled()
const;
508 void setArtPartSmoothingPeriod(
float period);
509 float artPartSmoothingPeriod()
const;
516 DtModel* model,
const std::string &lightPointGroup,
bool isSimpleModel);
533 void setOrientation(
DtUniqueID uniqueID,
const DtTaitBryan& orientation);
534 void setOrientationOffset(
DtUniqueID uniqueID,
const DtTaitBryan& orientation);
537 void setPosition(
DtUniqueID uniqueID,
const osg::Vec3d& vPosition);
538 void setPositionOffset(
DtUniqueID uniqueID,
const osg::Vec3d& vPosition);
539 void setOrientation(
DtUniqueID uniqueID,
const osg::Quat& orientation);
540 void setOrientationOffset(
DtUniqueID uniqueID,
const osg::Quat& orientation);
543 void setVisible(
DtUniqueID uniqueID,
bool bVisible);
546 void setBlendColor(
DtUniqueID uniqueID,
float r,
float g,
float b,
float a);
552 void setModelScaling(
DtUniqueID uniqueID,
bool bModelScaling,
float scale);
555 void setCullParameters(
DtUniqueID uniqueID,
unsigned int nodeMask,
bool visible);
563 typedef std::vector<InstanceMatrix, tbb::cache_aligned_allocator<InstanceMatrix> >
InstanceMatrixVec;
625 inline const osg::View*
lastView() {
return myLastView; }
628 inline const osg::Camera*
lastCamera() {
return myLastCamera; }
632 return myInstanceDataOffsets[instanceIx].myDrawables.offset;
638 return myInstanceDataOffsets[instanceIx].myMatrixes.offset;
644 unsigned int matrixIx = myInstanceDataOffsets[instanceIx].myMatrixes.offset;
648 matrixIx += drawableOffset;
654 void reloadShaders();
663 virtual void traverse(osg::NodeVisitor& nv);
666 virtual void update(osg::NodeVisitor& nv);
672 virtual void updateForIntersection(
double simTime,
const osg::View* view, osg::Camera* camera,
unsigned int nodeMask,
DtOsgCullVisitorParameters* params);
678 virtual float lightpointRange(
unsigned int instanceIx);
683 virtual void setDefaultLightPointMaxDistance(
float distance );
686 virtual float defaultLightPointMaxDistance()
const;
692 virtual void setLightPointFadeBias(
float bias );
695 virtual bool cullDistanceEnabled();
699 virtual float cullDistance();
704 virtual std::string modelDefinitionNameProxy(
const std::string& modelDefName);
708 DtVirtualBaseClass* findCachedData(
const std::string& modelType,
const std::string& name);
714 void setCachedData(
const std::string& modelType,
const std::string& name,
DtVirtualBaseClass* data);
717 void clearCachedData();
719 void releaseGLObjects(osg::State* state);
722 void updateBuffers(
const osg::View* view);
726 void updateLightPoints(
const osg::Camera* camera,
const osg::FrameStamp* frameStamp, osgUtil::CullVisitor* cv,
const osg::Camera* sceneCamera = NULL);
729 void addImguiStats()
const;
732 void resetTboSendFlag();
747 double l, r, b,
t, n, f;
756 osgUtil::LineSegmentIntersector::Intersection
result;
900 typedef boost::unordered_map<std::string, DtVirtualBaseClass*>
CacheMap;
915 void update(
double simTime,
const osg::View* view, osg::Camera* camera,
916 unsigned int nodeMask, osgUtil::CullVisitor* cv,
920 void registerGeometry(
unsigned int templateIx, osg::Geometry* geometry,
VpMap& vpMap);
923 float computeDistanceToEye(
const Eyepoint& eye,
const osg::Vec3d& pos)
const;
926 void updateOffsetsAndDistancesToEye(
const Eyepoint& eye);
929 void _updateOffsetsAndDistancesToEye(
const Eyepoint& eye,
unsigned int instanceOffset,
unsigned int numInstances);
932 void allocateRenderList();
935 void updateDataAndDrawables(
unsigned int offset,
unsigned int count);
940 unsigned int updateRenderList(
const Eyepoint& eye,
const osg::Matrixd& viewMat,
unsigned int nodeMask);
942 void updateLights(
const osg::View* view);
943 void resizeBuffersIfNecessary(
const osg::View* view,
int visibleCount);
944 void resizeTBOIfNecessary(
const osg::View* view,
int visibleCount);
949 void allocateInstanceData();
954 unsigned int fillRenderList(
unsigned int instanceOffset,
unsigned int numInstances);
958 ,
const std::vector<osg::Vec4d>& planes,
bool useScale,
unsigned int nodeMask
959 ,
unsigned int instanceOffset,
unsigned int instanceCount);
972 void createHitList(
const osg::Vec3d& end,
const osg::Vec3d& start, std::vector<InstancingHit>& hitList);
975 void loadInstanceShaders(osgEarth::VirtualProgram* vp);
978 const std::list<DtUniqueID>& ignoreList);
1039 virtual bool cull(osg::NodeVisitor* nv, osg::Drawable* drawable, osg::RenderInfo* renderInfo)
const
1067 typedef boost::unordered_map<const osg::View*, osg::ref_ptr<DtViewSpecificGroup> >
ViewToGroup;
1071 typedef boost::unordered_map<osg::Geometry*, osg::ref_ptr<DtPerViewUniformCallback> >
GeometryToCallback;
1080 void addInstanceRootToSceneGraphIfNecessary(
void);
1084 void processNewInstanceSwitches(
const InstanceTemplate& instanceTemplate,
bool isSimpleModel);
1085 void processNewInstanceSequences(
const InstanceTemplate& instanceTemplate);
1088 void processNewInstanceLightPoints(
const InstanceTemplate& instanceTemplate,
const std::string& lightPointGroup);
1091 void frustumCull(
const osg::View* view,
const Eyepoint& eye,
unsigned int nodeMask);
1096 void _fillRenderList(
bool globalScaling,
unsigned int instanceOffset,
unsigned int numInstances);
Contains the DtOsgTextureBufferObjectApplyAttribute class.
osg::Vec3f direction
Definition: DtInstanceManager.h:155
Wrapper for OpenGL Texture Buffer Object.
Definition: DtGlTextureBufferObject.h:27
Definition: DtInstanceManager.h:125
SequenceMode
Playback modes.
Definition: DtInstanceManager.h:125
std::vector< osg::View * > ViewVec
List of active views.
Definition: DtInstanceManager.h:1063
int groupId
Definition: DtInstanceManager.h:260
std::vector< int > myTemplateActiveInstances
Map number of active instances per template.
Definition: DtInstanceManager.h:1025
InstancedSequenceVec myInstancedSequences
Definition: DtInstanceManager.h:870
ModelTypeDofData()
Definition: DtInstanceManager.h:186
osg::Vec3f initialHpr
Initial HPR angles when instances are created.
Definition: DtInstanceManager.h:197
boost::signal< void(const std::string &)> signal_modelTypeRegistered
Emitted when a new model type is registered with the instancing system.
Definition: DtInstanceManager.h:392
InstanceCullDataVec & instanceCullData()
Per instance cull data.
Definition: DtInstanceManager.h:582
InstanceStateMap myIdToInstances
Map model DtUniqueID to instance index into myInstances array.
Definition: DtInstanceManager.h:986
Contains makVrv::DtInstanceManager declaration.
Contains makVrv::DtInstanceState declaration.
osg::Vec3d up
Definition: DtInstanceManager.h:741
float smoothCompleteTime
Frame time when smoothing is complete (if enabled).
Definition: DtInstanceManager.h:234
GeometryVec myDrawables
Drawables in registered instance templates.
Definition: DtInstanceManager.h:811
InstanceElementIdVec myElementIds
Array of per-instance element IDs.
Definition: DtInstanceManager.h:850
Virtual base class.
Definition: DtVirtualBaseClass.h:22
InstanceBufferVec myInstanceBuffers
Definition: DtInstanceManager.h:996
int memoryOffset
first location in the memory buffer for this list.
Definition: DtInstanceManager.h:787
std::vector< DtModel * > ModelVec
Definition: DtInstanceManager.h:559
InstanceMatrix initialTransform
Initial DOF transform when instances are created.
Definition: DtInstanceManager.h:194
ArrayRange myDrawables
Definition: DtInstanceManager.h:862
std::vector< osg::Vec4d > vecScratchPadPlanes
Definition: DtInstanceManager.h:1094
float boundingRadius
Radius of the model type's bounding sphere for culling (expanded by light ranges) ...
Definition: DtInstanceManager.h:327
float lastUpdate
Frame time of the most recent animation update.
Definition: DtInstanceManager.h:230
bool myRenderListDirty
True when myRenderList needs to be resized.
Definition: DtInstanceManager.h:803
osg::Vec3f hpr
Current Heading/Pitch/Roll angles in radians.
Definition: DtInstanceManager.h:224
InstancedDofVec & instancedDofs()
Definition: DtInstanceManager.h:598
osg::ref_ptr< osg::Geode > modelGeode
modelGeode pointer for the modelType of this template
Definition: DtInstanceManager.h:342
Template data for an instance of a model.
Definition: DtInstanceManager.h:290
std::vector< InstanceCullData > InstanceCullDataVec
Definition: DtInstanceManager.h:562
NodeVec myAnimatedModels
list of nodes that have animated bits.
Definition: DtInstanceManager.h:858
std::vector< GeometryRenderList > RenderList
Per drawable list of visible instance transforms.
Definition: DtInstanceManager.h:806
osg::ref_ptr< osg::LightSource > lightSource
Definition: DtInstanceManager.h:248
InstanceMatrixVec myDrawableInstanceMatrix
Spatial data for drawables in myDrawables.
Definition: DtInstanceManager.h:825
InstanceTemplateVec myInstanceTemplates
Per model definition templates for creating instances.
Definition: DtInstanceManager.h:797
osg::ref_ptr< DtInstanceNode > myInstanceRoot
Definition: DtInstanceManager.h:1047
unsigned int myCurrentDynamicBufferDataSize
Definition: DtInstanceManager.h:991
osg::Vec4 * myDynamicBufferData
Definition: DtInstanceManager.h:989
std::vector< DtInstanceState > InstanceStateVec
Definition: DtInstanceManager.h:558
unsigned int drawableOffsetMatrixIndex(const DtInstanceState &instanceState, unsigned int instanceIx, unsigned int drawableOffset)
Get the start index of the drawable spatial data for the specified instance.
Definition: DtInstanceManager.h:642
ViewVec myKnownViews
Definition: DtInstanceManager.h:1064
unsigned int attachDrawableIx
Definition: DtInstanceManager.h:249
InstanceProcessorVec myPreCullInstanceProcessors
Processors run before frustum culling.
Definition: DtInstanceManager.h:1058
std::vector< InstanceTemplate * > InstanceTemplateVec
Definition: DtInstanceManager.h:601
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
ViewToGroup myViewToGroup
Definition: DtInstanceManager.h:1068
ArrayRange lodRange
Range of LODs in this model.
Definition: DtInstanceManager.h:324
InstanceStateVec myInstances
Definition: DtInstanceManager.h:855
std::vector< char > BoolVec
Definition: DtInstanceManager.h:79
unsigned int drawableMatrixIx
Definition: DtInstanceManager.h:754
std::vector< InstancedLod * > LodVec
Definition: DtInstanceManager.h:285
NodeToDrawables myNodeToDrawablesMap
OSG nodes to instanced drawable range map.
Definition: DtInstanceManager.h:382
Instancing hit data structure.
Definition: DtInstanceManager.h:751
DtOsgIntersectorResult is the OSG-specific implementation of DtIntersectorResult; it is a container c...
Definition: DtOsgIntersector.h:62
std::vector< ModelTypeDofData > PerDofDataVec
Definition: DtInstanceManager.h:278
ByteVec & instanceVisibleSet()
Visibility of instances in current view.
Definition: DtInstanceManager.h:576
float startTime
Frametime the animation started playing at.
Definition: DtInstanceManager.h:134
boost::signal< void(const std::string &, DtUniqueID, DtElementID, DtModel *)> signal_instanceCreated
Emitted when a new instance of a model is added to the scene.
Definition: DtInstanceManager.h:395
osg::Vec3f boundingCenter
Offset from model origin to center of bounding sphere.
Definition: DtInstanceManager.h:333
std::vector< InstancedSwitch > InstancedSwitchVec
Definition: DtInstanceManager.h:279
osg::Vec3f position
Definition: DtInstanceManager.h:154
InstancedSwitchVec & instancedSwitches()
Definition: DtInstanceManager.h:594
osg::ref_ptr< const DtOsgCullVisitorParameters > myLastCullParameters
Most recent active cull vistor parameters.
Definition: DtInstanceManager.h:1075
InstanceMatrixVec & drawableInstanceMatrix()
Spatial state of instanced drawables in current view.
Definition: DtInstanceManager.h:579
DofAnimation()
Definition: DtInstanceManager.h:217
bool skipNextAnimationFrame
Flag to skip the next DOF animation frame (if any)
Definition: DtInstanceManager.h:177
unsigned int instanceIx
Definition: DtInstanceManager.h:753
SwitchVec mySwitches
Definition: DtInstanceManager.h:358
float lightpointRange
Definition: DtInstanceManager.h:768
osg::Vec3d eye
Definition: DtInstanceManager.h:740
std::map< osg::Node *, ArrayRange > NodeToDrawables
Definition: DtInstanceManager.h:379
InstanceMatrix putMatrixInverse
Initial put matrix inverse.
Definition: DtInstanceManager.h:191
boost::unordered_map< std::string, int > modelTypeToTemplateMap
Map from model type names to template index.
Definition: DtInstanceManager.h:999
bool myArtPartSmoothingEnabled
Definition: DtInstanceManager.h:1106
InstancedSwitchVec myInstancedSwitches
Definition: DtInstanceManager.h:869
const osg::Camera * myLastCamera
Reference to the camera that most recently was used.
Definition: DtInstanceManager.h:894
std::vector< float > & distanceToEye()
Per-instance distances to eyepoint for the current camera.
Definition: DtInstanceManager.h:607
NodeVec mySwitchNodes
OSG nodes corresponding to mySwitches.
Definition: DtInstanceManager.h:374
unsigned int numChildren
Number of child DOF nodes under this node.
Definition: DtInstanceManager.h:169
double & lastUpdateTime()
Last time the instances were updated.
Definition: DtInstanceManager.h:613
DrawableRangeVec switchRanges
List of drawable ranges effected by each switch state in the switch.
Definition: DtInstanceManager.h:112
SequenceMode mode
Playback mode for the sequence.
Definition: DtInstanceManager.h:140
std::vector< float > InstanceScaleVec
Definition: DtInstanceManager.h:564
std::vector< int > myTemplateMaxInstances
Map maximum number of instances for each template that we've allocated space for. ...
Definition: DtInstanceManager.h:1022
ArrayRange drawableRange
Range of drawables in this model.
Definition: DtInstanceManager.h:318
osg::Vec3f pos
Definition: DtInstanceManager.h:755
osg::Vec2f uvOffset
Definition: DtInstanceManager.h:766
DtLight * light
Definition: DtInstanceManager.h:153
GeometryRenderList()
Definition: DtInstanceManager.h:777
ArrayRange instanceMatrixRange
Range of matrixes in this model.
Definition: DtInstanceManager.h:321
float intersectionBoundingRadius
Radius of the model type's bounding sphere used for intersections.
Definition: DtInstanceManager.h:330
TextureCoordinateVec myUVOffsets
Per instance UV offsets.
Definition: DtInstanceManager.h:829
boost::unordered_map< std::string, DtVirtualBaseClass * > CacheMap
Cached data for model definition specific data.
Definition: DtInstanceManager.h:900
DtUniqueID DtElementID
The ElementID is a specific type of unique ID used to represent VR-Vantage uniquely defined elements...
Definition: DtUniqueID.h:26
Creator for DtInstanceManager.
Definition: DtInstanceManager.h:1115
RenderList myRenderList
Definition: DtInstanceManager.h:808
osg::Vec3f filterColor
Definition: DtInstanceManager.h:767
ByteVec myInstanceVisibleSet
Array of Per instance visibility state.
Definition: DtInstanceManager.h:832
InstancedSequenceVec sequenceTemplate
Template sequence data.
Definition: DtInstanceManager.h:315
osg::ref_ptr< osg::Node > lightPoint
Definition: DtInstanceManager.h:258
float range
Definition: DtInstanceManager.h:250
BoolVec myVisibleSet
Per instanced drawable visibility state.
Definition: DtInstanceManager.h:820
NodeVec myDofNodes
OSG nodes corresponding to myPerDofData.
Definition: DtInstanceManager.h:371
GeometryToCallback myGeometryToCallback
Definition: DtInstanceManager.h:1072
BoolVec switchStates
Visibility state of each drawable range.
Definition: DtInstanceManager.h:115
ArrayRange drawableRange
Range of drawables under this DOF, relative to the first drawable in this model type.
Definition: DtInstanceManager.h:208
unsigned int matrixIndex(unsigned int instanceIx)
Get the start index of the drawable spatial data for the specified instance.
Definition: DtInstanceManager.h:636
std::vector< DofAnimation > DofAnimations
Definition: DtInstanceManager.h:281
unsigned int drawableIndex(unsigned int instanceIx)
Get the start index of the drawable spatial data for the specified instance.
Definition: DtInstanceManager.h:631
InstancedLodVec & instancedLods()
Definition: DtInstanceManager.h:592
const osg::Camera * lastCamera()
Camera that was most recently used to udate.
Definition: DtInstanceManager.h:628
osg::Vec3f hprVel
Current Heading/Pitch/Roll angular velocity in rad/s.
Definition: DtInstanceManager.h:227
BoolVec defaultSwitchStates
Default Visibility state of each drawable range (different from simple models than articulated part) ...
Definition: DtInstanceManager.h:118
Internal frustum record for culling.
Definition: DtInstanceManager.h:745
The abstract Channel Class.
Definition: DtChannel.h:29
unsigned int count
Number of drawables in the range.
Definition: DtInstanceState.h:42
List of transforms for visible instances of a drawable.
Definition: DtInstanceManager.h:775
std::vector< InstancedLight > InstancedLightVec
Definition: DtInstanceManager.h:566
DOF data that is constant across all instances of a model type.
Definition: DtInstanceManager.h:184
InstanceMatrix putMatrix
Initial put matrix.
Definition: DtInstanceManager.h:188
DofAnimations & dofAnimations()
Array of DOF animation data.
Definition: DtInstanceManager.h:610
LightSource()
Definition: DtInstanceManager.h:247
Specifies a per-instance flipbook sequence.
Definition: DtInstanceManager.h:122
Specifies a range of drawables in the drawable array.
Definition: DtInstanceState.h:20
Per-instance DOF data.
Definition: DtInstanceManager.h:160
LightPointVec myLightPointNodes
Light Point data.
Definition: DtInstanceManager.h:368
LightPoint()
Definition: DtInstanceManager.h:257
InstanceMatrix l2w
Definition: DtInstanceManager.h:763
unsigned int visibleCount() const
Definition: DtInstanceManager.h:658
Contains makVrv::DtVirtualBaseClass class.
PerDofDataVec dofTemplate
DOF data that is constant across all instances of this model.
Definition: DtInstanceManager.h:303
InstanceMatrix transform
Current DOF transform.
Definition: DtInstanceManager.h:164
InstanceScaleVec & instanceScales()
Scale of instances.
Definition: DtInstanceManager.h:573
unsigned int myNumThreads
Definition: DtInstanceManager.h:1013
tbb::atomic< unsigned int > count
Number of visible instances.
Definition: DtInstanceManager.h:785
Callback to always cull out a drawable.
Definition: DtInstanceManager.h:1037
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points.
results of the parsing visitor
Definition: DtInstanceManager.h:352
const osg::View * view
Buffer is specific to this view.
Definition: DtInstanceManager.h:267
osg::Vec3f smoothTransVel
If actively smoothing, use this velocity instead for translation.
Definition: DtInstanceManager.h:237
Manages data for instanced rendering system and kicks off DtInstanceProcessors to update instance sta...
Definition: DtInstanceManager.h:75
osg::Matrixf InstanceMatrix
Type of osg matrix to use for transforms relative to instance base.
Definition: DtInstanceState.h:46
tbb::atomic< int > myVisibleCount
Definition: DtInstanceManager.h:1098
tbb::spin_rw_mutex myMapMutex
Definition: DtInstanceManager.h:987
float speed
Speed multiplier for the animation; set negative to play in reverse.
Definition: DtInstanceManager.h:143
unsigned int drawableIx
Definition: DtInstanceManager.h:156
osg::Vec3d center
Definition: DtInstanceManager.h:739
std::vector< float > myDistanceToEye
Per-instance distances to eyepoint for the current camera.
Definition: DtInstanceManager.h:835
std::vector< InstancedLod > InstancedLodVec
Definition: DtInstanceManager.h:560
IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2 &size, const ImVec2 &uv0=ImVec2(0, 0), const ImVec2 &uv1=ImVec2(1, 1), const ImVec4 &tint_col=ImVec4(1, 1, 1, 1), const ImVec4 &border_col=ImVec4(0, 0, 0, 0))
osg::Vec3f smoothHprVel
If actively smoothing, use this velocity instead for rotation.
Definition: DtInstanceManager.h:240
DtDe & myDe
Definition: DtInstanceManager.h:1132
std::vector< osg::ref_ptr< osg::Geometry > > GeometryVec
Definition: DtInstanceManager.h:78
LightPointVec myInstancedLightPoints
Definition: DtInstanceManager.h:873
std::map< osg::ref_ptr< osgEarth::VirtualProgram >, osg::ref_ptr< osgEarth::VirtualProgram > > VpMap
Definition: DtInstanceManager.h:81
ArrayRange dofRange
Range of instanced DOF nodes in this instance.
Definition: DtInstanceState.h:99
InstancedSwitchVec switchTemplate
Template switch data.
Definition: DtInstanceManager.h:312
const DtOsgCullVisitorParameters * lastCullParameters()
Last cull parameters from the renderer.
Definition: DtInstanceManager.h:616
DrawableRangeVec switchRanges
Per-frame ranges of drawables to display.
Definition: DtInstanceManager.h:128
InstanceCullDataVec myInstanceCullData
Array of per-instance culling data.
Definition: DtInstanceManager.h:847
Per-instance culling parameters.
Definition: DtInstanceState.h:51
std::vector< InstanceMatrix, tbb::cache_aligned_allocator< InstanceMatrix > > InstanceMatrixVec
Definition: DtInstanceManager.h:563
InstanceScaleVec myInstanceScales
Array of per-instance model scale factors.
Definition: DtInstanceManager.h:838
Class to manage disconnection of boost connections on deletion.
Definition: DtSignalConnectionManager.h:24
The osg cull vistor parameters class provides additional culling and intersector parameters for choos...
Definition: DtOsgCullVisitorParameters.h:38
int myNeedsMainThreadTextureUpdate
Definition: DtInstanceManager.h:1100
InstanceTemplate()
Definition: DtInstanceManager.h:292
ArrayRange drawableRange
Range of drawables this LOD effects.
Definition: DtInstanceManager.h:103
osg::MatrixTransform * myAnimatedMatrix
pointer to optional animation matrix that gets synced to the transform
Definition: DtInstanceManager.h:180
std::vector< InstancedSequence * > SequenceVec
Definition: DtInstanceManager.h:284
const osg::View * lastView()
View that most recently called update.
Definition: DtInstanceManager.h:625
PerDofDataVec myPerDofData
Definition: DtInstanceManager.h:359
unsigned int myCurrentTBBChunkSize
Definition: DtInstanceManager.h:1104
LightPointVec lightPoints
LightPoint data.
Definition: DtInstanceManager.h:309
std::vector< InstancedSwitch * > SwitchVec
Definition: DtInstanceManager.h:283
Eyepoint for a view.
Definition: DtInstanceManager.h:737
std::vector< osg::ref_ptr< osgEarth::VirtualProgram > > VpRefList
Definition: DtInstanceManager.h:82
virtual bool cull(osg::NodeVisitor *nv, osg::Drawable *drawable, osg::RenderInfo *renderInfo) const
Definition: DtInstanceManager.h:1039
ModelVec myModelInstances
Definition: DtInstanceManager.h:856
Definition: DtInstanceManager.h:245
std::vector< char > ByteVec
Definition: DtInstanceManager.h:80
osg::Vec3f transVel
Definition: DtInstanceManager.h:221
int myAnimatedNodeCount
has osg transform nodes
Definition: DtInstanceManager.h:385
InstancedLodVec myInstancedLods
Definition: DtInstanceManager.h:868
tbb::concurrent_queue< unsigned int > myListToRemove
Definition: DtInstanceManager.h:903
LightSourceVec lightSources
Lightsource data.
Definition: DtInstanceManager.h:306
modelTypeToTemplateMap myModelTypeToTemplate
Map model definition to its template index.
Definition: DtInstanceManager.h:1002
ArrayRange myAnimatedDofs
Definition: DtInstanceManager.h:864
unsigned long long DtUniqueID
Definition: DtUniqueID.h:22
std::string myAnimatedMatrixName
animated matrix info
Definition: DtInstanceManager.h:211
float timePerFrame
Frametime each frame of the animation should take.
Definition: DtInstanceManager.h:131
std::vector< unsigned int > myActiveDrawablesScratch
Definition: DtInstanceManager.h:814
Contains makVrv::DtModel class.
std::vector< InstancedSequence > InstancedSequenceVec
Definition: DtInstanceManager.h:280
std::vector< DtInstanceProcessor * > InstanceProcessorVec
Vector of instance processors.
Definition: DtInstanceManager.h:1052
std::vector< ArrayRange > DrawableRangeVec
Definition: DtInstanceManager.h:83
BoolVec & visibleSet()
Per instanced drawable visibility.
Definition: DtInstanceManager.h:619
InstanceTemplateVec & instanceTemplates()
Per model definition templates for creating instances.
Definition: DtInstanceManager.h:604
const osg::View * myLastView
Reference to view that most recently called update.
Definition: DtInstanceManager.h:891
ArrayRange myMatrixes
Definition: DtInstanceManager.h:863
CullSet myPerViewCullResults
Storage for per-view cull set calculation.
Definition: DtInstanceManager.h:897
InstancedDof()
Definition: DtInstanceManager.h:162
unsigned int nodeMask
Per model type nodemask to capture model definition settings.
Definition: DtInstanceManager.h:339
LightSourceVec myLightSources
Light source data.
Definition: DtInstanceManager.h:365
SequenceVec mySequences
Definition: DtInstanceManager.h:361
InstancedLightVec myInstancedLights
Definition: DtInstanceManager.h:872
FloatVec myInstanceLightpointRange
Array of per-instance max lightpoint distances squared.
Definition: DtInstanceManager.h:844
std::string myInstanceVS
Definition: DtInstanceManager.h:1102
Base class for handling DtChannels.
Definition: DtChannelManager.h:35
InstancedSequenceVec & instancedSequences()
Definition: DtInstanceManager.h:596
NodeVec mySequenceNodes
OSG nodes corresponding to mySequences.
Definition: DtInstanceManager.h:377
float myArtPartSmoothingPeriod
Definition: DtInstanceManager.h:1107
unsigned int attachDrawableIx
Definition: DtInstanceManager.h:259
GeometryVec myDrawables
Definition: DtInstanceManager.h:360
std::vector< DtElementID > InstanceElementIdVec
Definition: DtInstanceManager.h:565
std::vector< InstancedDof > InstancedDofVec
Definition: DtInstanceManager.h:561
Base class to provide boost signal/slot management.
osgUtil::LineSegmentIntersector::Intersection result
Definition: DtInstanceManager.h:756
boost::unordered_map< const osg::View *, osg::ref_ptr< DtViewSpecificGroup > > ViewToGroup
Map from views to the group node that activates their instance buffer.
Definition: DtInstanceManager.h:1067
unsigned int dynamicBufferDataSize() const
Definition: DtInstanceManager.h:660
float userDefined
Definition: DtInstanceManager.h:765
FloatVec myInstanceUserDefined
Array of per-instance user-defined floats.
Definition: DtInstanceManager.h:841
Per-instance light source data.
Definition: DtInstanceManager.h:150
Class for generic lights.
Definition: DtLight.h:48
unsigned int myDynamicBufferDataSz
Definition: DtInstanceManager.h:990
GeometryVec & drawables()
Definition: DtInstanceManager.h:656
CacheMap myRuntimeCache
Definition: DtInstanceManager.h:901
Per instanced DOF animation data.
Definition: DtInstanceManager.h:215
const char int mode
Definition: ioapi.h:38
Transform matrix for an instanced drawable to render with.
Definition: DtInstanceManager.h:761
TextureCoordinateVec & uvOffsets()
UV Offset state of drawable instances.
Definition: DtInstanceManager.h:588
Per view buffer of instances.
Definition: DtInstanceManager.h:264
double minRange
Minimum distance to eye for this LOD to be visible.
Definition: DtInstanceManager.h:95
osg::ref_ptr< DtInstanceManagerTboUpdater > myDrawCallUpdater
Definition: DtInstanceManager.h:1099
A model which owns a single model instance.
Definition: DtModel.h:56
Contains makVrv::DtUniqueID type.
std::vector< RenderState > RenderStateVec
List of transform matrices that will be used to render instances of a particular drawable.
Definition: DtInstanceManager.h:772
InstanceProcessorVec myPostCullInstanceProcessors
Processors run after frustum culling.
Definition: DtInstanceManager.h:1055
LodVec myLods
Definition: DtInstanceManager.h:357
float myDefaultLightPointRange
Definition: DtInstanceManager.h:1077
bool isRangeScheme
Definition: DtInstanceManager.h:251
Contains DLL export macros.
Specifies a per-instance switch.
Definition: DtInstanceManager.h:109
DtGlTextureBufferObject * image
Instance data.
Definition: DtInstanceManager.h:270
std::map< const InstanceTemplate *, int > myNewTemplates
Definition: DtInstanceManager.h:1103
DofAnimations myDofAnimations
Array of DOF animation data.
Definition: DtInstanceManager.h:878
bool daylightControlledLights
Whether or not lights in this model type turn off during daylight.
Definition: DtInstanceManager.h:345
unsigned int getcount() const
Definition: DtInstanceManager.h:788
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
int lastFrame
Most recent frame that was rendered.
Definition: DtInstanceManager.h:146
ParserOutput()
Definition: DtInstanceManager.h:354
std::string myName
Definition: DtInstanceManager.h:300
osg::Vec3d & cameraPosition()
Camera position of the most recent camera that called update.
Definition: DtInstanceManager.h:622
float scale
Definition: DtInstanceManager.h:764
Instance template light point data.
Definition: DtInstanceManager.h:255
InstanceElementIdVec & elementIds()
Element IDs of instances.
Definition: DtInstanceManager.h:570
ArrayRange drawableRange
Range of drawables under this DOF.
Definition: DtInstanceManager.h:172
std::vector< LightPoint > LightPointVec
Definition: DtInstanceManager.h:286
unsigned int myRequiredUvOffsets
Number of UV offsets required by current allocated instances.
Definition: DtInstanceManager.h:1008
std::vector< float > FloatVec
Definition: DtInstanceManager.h:85
unsigned int myLastNodeMask
Nodemask used for last update.
Definition: DtInstanceManager.h:884
InstancedLight()
Definition: DtInstanceManager.h:152
InstanceStateVec & instances()
State of active instances.
Definition: DtInstanceManager.h:585
unsigned int numChildren
Number of child DOFs of this DOF.
Definition: DtInstanceManager.h:205
VpRefList myVpRefs
Definition: DtInstanceManager.h:1031
voidpf uLong offset
Definition: ioapi.h:42
RenderStateVec states
Drawable instance transforms.
Definition: DtInstanceManager.h:793
double myLastUpdateTime
Last time the instances were updated.
Definition: DtInstanceManager.h:881
Specifies an instanced LOD by min/max visible ranges and effected drawable range. ...
Definition: DtInstanceManager.h:92
DtDe & myDe
Definition: DtInstanceManager.h:1004
boost::signal< void(const CullSet &)> signal_updateFinished
Emitted when instance update is complete.
Definition: DtInstanceManager.h:398
osg::ref_ptr< TextureBufferObjectApplyAttribute > applyAttribute
Texture buffer attribute.
Definition: DtInstanceManager.h:273
osg::ref_ptr< AlwaysCull > myAlwaysCullCallback
Definition: DtInstanceManager.h:1045
boost::unordered_map< osg::Geometry *, osg::ref_ptr< DtPerViewUniformCallback > > GeometryToCallback
Map from geometry (drawable) to the callback that updates its start index uniform.
Definition: DtInstanceManager.h:1071
float endTime
Frametime to stop the animation at; -1 will loop indefinitely.
Definition: DtInstanceManager.h:137
std::vector< osg::Node * > NodeVec
Definition: DtInstanceManager.h:282
osg::Vec3f trans
Current translation in meters.
Definition: DtInstanceManager.h:219
std::vector< InstanceDataOffsets > myInstanceDataOffsets
Definition: DtInstanceManager.h:866
std::vector< DtUniqueID > CullSet
Definition: DtInstancedCullSet.h:16
Definition: DtInstanceManager.h:860
bool myTboSendFlag
Definition: DtInstanceManager.h:1108
float myLightPointFadeBias
Definition: DtInstanceManager.h:1078
int myAnimatedNodeCount
how many animated node this object has
Definition: DtInstanceManager.h:348
std::vector< osg::Vec2f > TextureCoordinateVec
Definition: DtInstanceManager.h:84
osg::Vec3f initialTranslate
Initial translation when instances are created.
Definition: DtInstanceManager.h:200
osg::Vec3d myCameraPosition
Camera position of the most recent camera that called update.
Definition: DtInstanceManager.h:888
double t
Definition: DtInstanceManager.h:747
double maxRange
Maximum distance to eye for this LOD to be visible.
Definition: DtInstanceManager.h:98
std::vector< InstanceBuffer > InstanceBufferVec
Vector of per-view instance data buffers.
Definition: DtInstanceManager.h:994
boost::unordered_map< DtUniqueID, unsigned int > InstanceStateMap
Map from instance unique ID to the index into myInstances for that instance.
Definition: DtInstanceManager.h:983
std::vector< LightSource > LightSourceVec
Definition: DtInstanceManager.h:277
InstancedDofVec myInstancedDofs
Definition: DtInstanceManager.h:871
Per-instance state information.
Definition: DtInstanceState.h:70
VpMap myVpMap
Definition: DtInstanceManager.h:1030