![]() |
VR-Forces 4.8 Class Documentation
|
Manages data for instanced rendering system and kicks off DtInstanceProcessors to update instance state. More...

Classes | |
| class | AlwaysCull |
| Callback to always cull out a drawable. More... | |
| struct | DofAnimation |
| Per instanced DOF animation data. More... | |
| struct | Eyepoint |
| Eyepoint for a view. More... | |
| struct | Frustum |
| Internal frustum record for culling. More... | |
| struct | GeometryRenderList |
| List of transforms for visible instances of a drawable. More... | |
| struct | InstanceBuffer |
| Per view buffer of instances. More... | |
| struct | InstanceDataOffsets |
| struct | InstancedDof |
| Per-instance DOF data. More... | |
| struct | InstancedLight |
| Per-instance light source data. More... | |
| struct | InstancedLod |
| Specifies an instanced LOD by min/max visible ranges and effected drawable range. More... | |
| struct | InstancedSequence |
| Specifies a per-instance flipbook sequence. More... | |
| struct | InstancedSwitch |
| Specifies a per-instance switch. More... | |
| struct | InstanceTemplate |
| Template data for an instance of a model. More... | |
| struct | InstancingHit |
| Instancing hit data structure. More... | |
| struct | LightPoint |
| Instance template light point data. More... | |
| struct | LightSource |
| struct | ModelTypeDofData |
| DOF data that is constant across all instances of a model type. More... | |
| struct | ParserOutput |
| results of the parsing visitor More... | |
| struct | RenderState |
| Transform matrix for an instanced drawable to render with. More... | |
Public Types | |
| typedef std::vector < osg::ref_ptr< osg::Geometry > > | GeometryVec |
| typedef std::vector< char > | BoolVec |
| typedef std::vector< char > | ByteVec |
| typedef std::map< osg::ref_ptr < osgEarth::VirtualProgram > , osg::ref_ptr < osgEarth::VirtualProgram > > | VpMap |
| typedef std::vector < osg::ref_ptr < osgEarth::VirtualProgram > > | VpRefList |
| typedef std::vector< ArrayRange > | DrawableRangeVec |
| typedef std::vector< osg::Vec2f > | TextureCoordinateVec |
| typedef std::vector< float > | FloatVec |
| typedef std::vector < InstanceTemplate * > | InstanceTemplateVec |
| typedef std::vector< LightSource > | LightSourceVec |
| typedef std::vector < ModelTypeDofData > | PerDofDataVec |
| typedef std::vector < InstancedSwitch > | InstancedSwitchVec |
| typedef std::vector < InstancedSequence > | InstancedSequenceVec |
| typedef std::vector< DofAnimation > | DofAnimations |
| typedef std::vector< osg::Node * > | NodeVec |
| typedef std::vector < InstancedSwitch * > | SwitchVec |
| typedef std::vector < InstancedSequence * > | SequenceVec |
| typedef std::vector < InstancedLod * > | LodVec |
| typedef std::vector< LightPoint > | LightPointVec |
| typedef std::vector < DtInstanceState > | InstanceStateVec |
| typedef std::vector< DtModel * > | ModelVec |
| typedef std::vector< InstancedLod > | InstancedLodVec |
| typedef std::vector< InstancedDof > | InstancedDofVec |
| typedef std::vector < InstanceCullData > | InstanceCullDataVec |
| typedef std::vector < InstanceMatrix, tbb::cache_aligned_allocator < InstanceMatrix > > | InstanceMatrixVec |
| typedef std::vector< float > | InstanceScaleVec |
| typedef std::vector< DtElementID > | InstanceElementIdVec |
| typedef std::vector < InstancedLight > | InstancedLightVec |
Public Member Functions | |
| bool | intersect (const osg::Vec3d &start, const osg::Vec3d &end, const osg::Vec3d &reference, DtOsgIntersectorResult &result, std::list< DtUniqueID > *ignoreList=0) |
| Find the closest instance intersection to the reference point along the line segment from start to end. More... | |
| bool | intersect (const osg::Vec3d &start, const osg::Vec3d &end, std::vector< DtOsgIntersectorResult > &results, std::list< DtUniqueID > *ignoreList=0) |
| Find the instance intersections to the start point along a line segment. More... | |
| void | setElementId (DtUniqueID id, DtUniqueID elementId) |
| Set the element ID for an instanced model. More... | |
| osg::StateSet * | getModelTypeRootStateSet (const std::string &modelType) |
| Get the root state set for a particular type of model. More... | |
| DtInstanceManager (DtDe &de) | |
| CTOR. More... | |
| virtual | ~DtInstanceManager () |
| DTOR. More... | |
| virtual void | reset () |
| Clear everything in the instance manager. More... | |
| virtual osg::Node * | instanceRoot () |
| Get the root node containing all instanced geometry. More... | |
| bool | isRegistered (const std::string &modelType) |
| Check whether a model is registered and ready for instancing. More... | |
| void | registerModel (const std::string &modelType, const ParserOutput &parseOutput, float boundingRadius, const DtVector &boundingCenter, unsigned int nodeMask, const osg::ref_ptr< osg::StateSet > &rootNodeSS, bool daylightControlledLights=false) |
| Register a model for instancing. More... | |
| osg::Geode * | setupModelGeode (const std::string &modelType, unsigned int nodeMask) |
| Set up a geode to contain instances of a model. More... | |
| void | allocateImage (const osg::View *view) |
| Allocate an instance texture for the specified view. More... | |
| void | freeInstance (DtUniqueID id) |
| Free the instance with the specified ID. More... | |
| void | drainFreeInstanceList () |
| Free the instance with the specified ID in main thread. More... | |
| void | setArtPartSmoothingEnabled (bool onOrOff) |
| bool | artPartSmoothingEnabled () const |
| void | setArtPartSmoothingPeriod (float period) |
| float | artPartSmoothingPeriod () const |
| bool | newInstance (const std::string &modelType, DtUniqueID id, DtElementID elementId, short modelSet, DtModel *model, const std::string &lightPointGroup, bool isSimpleModel) |
| Set up a new instance of the specified model. More... | |
| DtInstanceState * | findInstanceState (DtUniqueID id) |
| Find the specified instance's state. More... | |
| InstanceCullData * | findInstanceCullData (DtUniqueID id) |
| Find the culling data for the specified instance. More... | |
| void | setPosition (DtUniqueID uniqueID, const DtVector &vPosition) |
| Set Position and orientation off of Dt types. More... | |
| void | setPositionOffset (DtUniqueID uniqueID, const DtVector &vPosition) |
| void | setOrientation (DtUniqueID uniqueID, const DtTaitBryan &orientation) |
| void | setOrientationOffset (DtUniqueID uniqueID, const DtTaitBryan &orientation) |
| void | setPosition (DtUniqueID uniqueID, const osg::Vec3d &vPosition) |
| Set Position and orientation off of osg types. More... | |
| void | setPositionOffset (DtUniqueID uniqueID, const osg::Vec3d &vPosition) |
| void | setOrientation (DtUniqueID uniqueID, const osg::Quat &orientation) |
| void | setOrientationOffset (DtUniqueID uniqueID, const osg::Quat &orientation) |
| void | setVisible (DtUniqueID uniqueID, bool bVisible) |
| Set visibility. More... | |
| void | setBlendColor (DtUniqueID uniqueID, float r, float g, float b, float a) |
| Set the blending color. More... | |
| void | setModelScaling (DtUniqueID uniqueID, bool bModelScaling, float scale) |
| Set the model scaling /param uniqueID the ID of the model /param bModelScaling if global modelScaling is enabled /param scale the individual scale from the model definition, separate from the global scale. More... | |
| void | setCullParameters (DtUniqueID uniqueID, unsigned int nodeMask, bool visible) |
| Set the various culling parameters. More... | |
| InstanceElementIdVec & | elementIds () |
| Element IDs of instances. More... | |
| InstanceScaleVec & | instanceScales () |
| Scale of instances. More... | |
| ByteVec & | instanceVisibleSet () |
| Visibility of instances in current view. More... | |
| InstanceMatrixVec & | drawableInstanceMatrix () |
| Spatial state of instanced drawables in current view. More... | |
| InstanceCullDataVec & | instanceCullData () |
| Per instance cull data. More... | |
| InstanceStateVec & | instances () |
| State of active instances. More... | |
| TextureCoordinateVec & | uvOffsets () |
| UV Offset state of drawable instances. More... | |
| InstanceTemplateVec & | instanceTemplates () |
| Per model definition templates for creating instances. More... | |
| std::vector< float > & | distanceToEye () |
| Per-instance distances to eyepoint for the current camera. More... | |
| DofAnimations & | dofAnimations () |
| Array of DOF animation data. More... | |
| double & | lastUpdateTime () |
| Last time the instances were updated. More... | |
| const DtOsgCullVisitorParameters * | lastCullParameters () |
| Last cull parameters from the renderer. More... | |
| BoolVec & | visibleSet () |
| Per instanced drawable visibility. More... | |
| osg::Vec3d & | cameraPosition () |
| Camera position of the most recent camera that called update. More... | |
| const osg::View * | lastView () |
| View that most recently called update. More... | |
| const osg::Camera * | lastCamera () |
| Camera that was most recently used to udate. More... | |
| unsigned int | drawableIndex (unsigned int instanceIx) |
| Get the start index of the drawable spatial data for the specified instance. More... | |
| unsigned int | matrixIndex (unsigned int instanceIx) |
| Get the start index of the drawable spatial data for the specified instance. More... | |
| 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. More... | |
| void | reloadShaders () |
| Reload instancing shaders. More... | |
| GeometryVec & | drawables () |
| unsigned int | visibleCount () const |
| unsigned int | dynamicBufferDataSize () const |
| virtual void | traverse (osg::NodeVisitor &nv) |
| needed to run material callbacks More... | |
| virtual void | update (osg::NodeVisitor &nv) |
| needed to run animation callbacks More... | |
| virtual void | updateForIntersection (double simTime, const osg::View *view, osg::Camera *camera, unsigned int nodeMask, DtOsgCullVisitorParameters *params) |
| update function for preparing the instance manger for an intersection used by the DtInstanceManager::instersect call to update the locations of the geometry if necessary (if it has not already been done for this frame by updateForDrawing) this does not update the light point drawables using the cull visitor like the updateForDrawing does. More... | |
| virtual void | updateForDrawing (osgUtil::CullVisitor *cv, const DtOsgCullVisitorParameters *params) |
| update function for preparing the instance manager for being drawn called once per view. More... | |
| virtual float | lightpointRange (unsigned int instanceIx) |
| virtual void | setDefaultLightPointMaxDistance (float distance) |
| Set the max distance for lightpoints. More... | |
| virtual float | defaultLightPointMaxDistance () const |
| Get the max distance for lightpoints. More... | |
| virtual void | setLightPointFadeBias (float bias) |
| Lightpoint range is used to fade from max brightness (alpha = 1) to 0 at max range. More... | |
| virtual bool | cullDistanceEnabled () |
| Overridw the cull distance used in the instance manager. More... | |
| virtual float | cullDistance () |
| Get the distance used if culling override is enabled Set with the slider in the experimental features dialog. More... | |
| virtual std::string | modelDefinitionNameProxy (const std::string &modelDefName) |
| Returns proxy model definition name generated from the model definition. More... | |
| DtVirtualBaseClass * | findCachedData (const std::string &modelType, const std::string &name) |
| Lookup cached data. More... | |
| void | setCachedData (const std::string &modelType, const std::string &name, DtVirtualBaseClass *data) |
| Adds a data member to the cache. More... | |
| void | clearCachedData () |
| Clear previously allocated memory (to be called from the destructor) More... | |
| void | releaseGLObjects (osg::State *state) |
| void | updateBuffers (const osg::View *view) |
| should only be called by the tbo updater in order to update the tbos More... | |
| void | updateLightPoints (const osg::Camera *camera, const osg::FrameStamp *frameStamp, osgUtil::CullVisitor *cv, const osg::Camera *sceneCamera=NULL) |
| loop over the light point nodes and send down the model view matrix for each instance. More... | |
| void | addImguiStats () const |
| added stats More... | |
| void | resetTboSendFlag () |
| called by precull event More... | |
| void | setSequenceMode (const DtInstanceState &instance, unsigned int sequenceIndex, InstancedSequence::SequenceMode mode) |
| void | setSequenceSpeed (const DtInstanceState &instance, unsigned int sequenceIndex, float speed) |
| Set the playback speed for the specified sequence. More... | |
| void | setSequencePlayTime (const DtInstanceState &instance, unsigned int sequenceIndex, float loopTime) |
| Set the time the specified sequence should play for, starting now. More... | |
| InstanceMatrix | dofState (const DtInstanceState &instanceState, unsigned int partIndex) |
| void | setDofState (InstanceMatrix &m, const DtInstanceState &state, unsigned int partIndex) |
| void | setDofAnimation (osg::Vec3f &hpr, const osg::Vec3f &hprVel, const DtInstanceState &state, unsigned int partIndex) |
| Set the DOF animation state for the specified instanced DOF. More... | |
| void | setDofRotationalVelocity (const osg::Vec3f &hprVel, const DtInstanceState &state, unsigned int partIndex, bool forceUpdate=true) |
| Set the DOF rotational velocity state for the specified instanced DOF. More... | |
| void | setDofTranslation (osg::Vec3f &trans, osg::Vec3f &transVel, const DtInstanceState &state, unsigned int partIndex) |
| Set the DOF translation state for the specified instanced DOF. More... | |
| void | setSwitchState (const DtInstanceState &instance, unsigned int partIndex, unsigned int childIndex, bool state) |
| void | setUVOffset (DtUniqueID id, unsigned int drawableIx, unsigned int count, const osg::Vec2f &uvOffset) |
| void | setUserDefined (DtUniqueID id, float userDefined) |
| void | setLightpointRange (DtUniqueID id, float range) |
Instanced scene graph accessors | |
| InstancedLodVec & | instancedLods () |
| InstancedSwitchVec & | instancedSwitches () |
| InstancedSequenceVec & | instancedSequences () |
| InstancedDofVec & | instancedDofs () |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| Do nothing constructor. More... | |
| virtual | ~DtVirtualBaseClass () |
| Virtual do nothing destructor. More... | |
Public Member Functions inherited from makVrv::DtSignalConnectionManager | |
| DtSignalConnectionManager () | |
| CTOR. More... | |
| virtual | ~DtSignalConnectionManager () |
| DTOR. More... | |
| void | manageConnection (const boost::signalslib::connection &conn) |
| Connect a signal. More... | |
| void | manageConnection (const boost::signalslib2::connection &conn) |
| DtSignalConnectionManager & | operator+= (const boost::signalslib::connection &conn) |
| Connect a signal. More... | |
| DtSignalConnectionManager & | operator+= (const boost::signalslib2::connection &conn) |
| bool | blockConnections (bool blocked) |
| Blocks/unblocks connections. More... | |
| int | numberOfConnections () const |
| Get the number of connections. More... | |
| void | disconnectSignals () |
| Disconnect all signals. More... | |
| bool | connectionsBlocked () const |
| check whether connections are blocked. More... | |
Static Public Member Functions | |
| static DtInstanceManager & | instance (DtDe &de) |
| Get an instance of the instance manager. More... | |
Public Attributes | |
Signals | |
| boost::signal< void(const std::string &)> | signal_modelTypeRegistered |
| Emitted when a new model type is registered with the instancing system. More... | |
| boost::signal< void(const std::string &, DtUniqueID, DtElementID, DtModel *)> | signal_instanceCreated |
| Emitted when a new instance of a model is added to the scene. More... | |
| boost::signal< void(const CullSet &)> | signal_updateFinished |
| Emitted when instance update is complete. More... | |
Static Public Attributes | |
| static const unsigned int | NumVec4PerInstance = 8 |
| Number of vec4 slots per instance in the instance data buffer. More... | |
Protected Types | |
| typedef std::vector< RenderState > | RenderStateVec |
| List of transform matrices that will be used to render instances of a particular drawable. More... | |
| typedef std::vector < GeometryRenderList > | RenderList |
| Per drawable list of visible instance transforms. More... | |
| typedef boost::unordered_map < std::string, DtVirtualBaseClass * > | CacheMap |
| Cached data for model definition specific data. More... | |
| typedef boost::unordered_map < DtUniqueID, unsigned int > | InstanceStateMap |
| Map from instance unique ID to the index into myInstances for that instance. More... | |
| typedef std::vector < InstanceBuffer > | InstanceBufferVec |
| Vector of per-view instance data buffers. More... | |
| typedef boost::unordered_map < std::string, int > | modelTypeToTemplateMap |
| Map from model type names to template index. More... | |
| typedef std::vector < DtInstanceProcessor * > | InstanceProcessorVec |
| Vector of instance processors. More... | |
| typedef std::vector< osg::View * > | ViewVec |
| List of active views. More... | |
| typedef boost::unordered_map < const osg::View *, osg::ref_ptr < DtViewSpecificGroup > > | ViewToGroup |
| Map from views to the group node that activates their instance buffer. More... | |
| typedef boost::unordered_map < osg::Geometry *, osg::ref_ptr < DtPerViewUniformCallback > > | GeometryToCallback |
| Map from geometry (drawable) to the callback that updates its start index uniform. More... | |
Protected Types inherited from makVrv::DtSignalConnectionManager | |
| typedef std::vector < boost::signalslib::connection > | Connections |
| A collection of signals. More... | |
| typedef std::vector < boost::signalslib2::connection > | Connections2 |
Protected Member Functions | |
| void | update (double simTime, const osg::View *view, osg::Camera *camera, unsigned int nodeMask, osgUtil::CullVisitor *cv, const DtOsgCullVisitorParameters *params, bool suppressLastUpdateTime) |
| Update the instances. More... | |
| void | registerGeometry (unsigned int templateIx, osg::Geometry *geometry, VpMap &vpMap) |
| Set up a geometry object for instanced rendering. More... | |
| float | computeDistanceToEye (const Eyepoint &eye, const osg::Vec3d &pos) const |
| Compute the distance from an eyepoint to a point. More... | |
| void | updateOffsetsAndDistancesToEye (const Eyepoint &eye) |
| Apply any offsets to the instance and then update its distance from the eye point. More... | |
| void | _updateOffsetsAndDistancesToEye (const Eyepoint &eye, unsigned int instanceOffset, unsigned int numInstances) |
| Apply any offsets to the instance and then update its distance from the eye point. More... | |
| void | allocateRenderList () |
| Resize myRenderList to fit the current set of instances and drawables. More... | |
| void | updateDataAndDrawables (unsigned int offset, unsigned int count) |
| Update the instance texture for the specified view. More... | |
| unsigned int | updateRenderList (const Eyepoint &eye, const osg::Matrixd &viewMat, unsigned int nodeMask) |
| Update the per-drawable render lists using the computed visibility and instance spatial data. More... | |
| void | updateLights (const osg::View *view) |
| void | resizeBuffersIfNecessary (const osg::View *view, int visibleCount) |
| void | resizeTBOIfNecessary (const osg::View *view, int visibleCount) |
| void | allocateInstanceData () |
| Allocate space for instance data that isn't contained in the instance struct itself, for the current number of instances. More... | |
| unsigned int | fillRenderList (unsigned int instanceOffset, unsigned int numInstances) |
| Fill the render list with data from the specified range of instances. More... | |
| void | cullRange (const Eyepoint &eye, const std::vector< osg::Vec4d > &planes, bool useScale, unsigned int nodeMask, unsigned int instanceOffset, unsigned int instanceCount) |
| Frustum cull the specified range of instances. More... | |
| void | slot_channelAdded (DtChannelManager *mgr, DtChannel *channel) |
| Update per-view resources when a channel is added. More... | |
| void | slot_channelRemoved (DtChannelManager *mgr, DtChannel *channel) |
| Clean up per-view resources when a channel is removed. More... | |
| void | clearTBO (InstanceBuffer &instanceBuffer) |
| Clean up a single texture buffer object Uses a reference to a pointer since it can set instTbo = NULL. More... | |
| void | createHitList (const osg::Vec3d &end, const osg::Vec3d &start, std::vector< InstancingHit > &hitList) |
| Support function for intersect for generating list of hits. More... | |
| void | loadInstanceShaders (osgEarth::VirtualProgram *vp) |
| reads the instance shaders from disk and attaches them to vp More... | |
| bool | isOnExcludeList (DtUniqueID elementId, const std::list< DtUniqueID > &ignoreList) |
| void | addInstanceRootToSceneGraphIfNecessary (void) |
| void | processNewInstanceLights (const InstanceTemplate &instanceTemplate) |
| void | processNewInstanceDOFs (DtModel *model, const InstanceTemplate &instanceTemplate) |
| void | processNewInstanceSwitches (const InstanceTemplate &instanceTemplate, bool isSimpleModel) |
| void | processNewInstanceSequences (const InstanceTemplate &instanceTemplate) |
| void | processNewInstanceLightPoints (const InstanceTemplate &instanceTemplate, const std::string &lightPointGroup) |
| initialize a new instance with it's group that it belongs to More... | |
| void | preCull () |
| void | frustumCull (const osg::View *view, const Eyepoint &eye, unsigned int nodeMask) |
| void | postCull () |
| void | _fillRenderList (bool globalScaling, unsigned int instanceOffset, unsigned int numInstances) |
Protected Member Functions inherited from makVrv::DtSignalConnectionManager | |
| bool | blockConnection (int index, bool blocked) |
| Blocks/unblocks connections. More... | |
| bool | connectionBlocked (int index) const |
| check whether connections are blocked. More... | |
Manages data for instanced rendering system and kicks off DtInstanceProcessors to update instance state.
Use instance processor objects to modify instance spatial data/visibility
| typedef std::vector<osg::ref_ptr<osg::Geometry> > makVrv::DtInstanceManager::GeometryVec |
| typedef std::vector<char> makVrv::DtInstanceManager::BoolVec |
| typedef std::vector<char> makVrv::DtInstanceManager::ByteVec |
| typedef std::map<osg::ref_ptr< osgEarth::VirtualProgram >, osg::ref_ptr<osgEarth::VirtualProgram> > makVrv::DtInstanceManager::VpMap |
| typedef std::vector<osg::ref_ptr<osgEarth::VirtualProgram> > makVrv::DtInstanceManager::VpRefList |
| typedef std::vector<ArrayRange> makVrv::DtInstanceManager::DrawableRangeVec |
| typedef std::vector<osg::Vec2f> makVrv::DtInstanceManager::TextureCoordinateVec |
| typedef std::vector<float> makVrv::DtInstanceManager::FloatVec |
| typedef std::vector<LightSource> makVrv::DtInstanceManager::LightSourceVec |
| typedef std::vector<ModelTypeDofData> makVrv::DtInstanceManager::PerDofDataVec |
| typedef std::vector<InstancedSwitch> makVrv::DtInstanceManager::InstancedSwitchVec |
| typedef std::vector<InstancedSequence> makVrv::DtInstanceManager::InstancedSequenceVec |
| typedef std::vector<DofAnimation> makVrv::DtInstanceManager::DofAnimations |
| typedef std::vector<osg::Node*> makVrv::DtInstanceManager::NodeVec |
| typedef std::vector<InstancedSwitch*> makVrv::DtInstanceManager::SwitchVec |
| typedef std::vector<InstancedSequence*> makVrv::DtInstanceManager::SequenceVec |
| typedef std::vector<InstancedLod*> makVrv::DtInstanceManager::LodVec |
| typedef std::vector<LightPoint> makVrv::DtInstanceManager::LightPointVec |
| typedef std::vector<DtInstanceState> makVrv::DtInstanceManager::InstanceStateVec |
| typedef std::vector<DtModel*> makVrv::DtInstanceManager::ModelVec |
| typedef std::vector<InstancedLod> makVrv::DtInstanceManager::InstancedLodVec |
| typedef std::vector<InstancedDof> makVrv::DtInstanceManager::InstancedDofVec |
| typedef std::vector<InstanceCullData> makVrv::DtInstanceManager::InstanceCullDataVec |
| typedef std::vector<InstanceMatrix, tbb::cache_aligned_allocator<InstanceMatrix> > makVrv::DtInstanceManager::InstanceMatrixVec |
| typedef std::vector<float> makVrv::DtInstanceManager::InstanceScaleVec |
| typedef std::vector<DtElementID> makVrv::DtInstanceManager::InstanceElementIdVec |
| typedef std::vector<InstancedLight> makVrv::DtInstanceManager::InstancedLightVec |
| typedef std::vector<InstanceTemplate*> makVrv::DtInstanceManager::InstanceTemplateVec |
|
protected |
List of transform matrices that will be used to render instances of a particular drawable.
|
protected |
Per drawable list of visible instance transforms.
|
protected |
Cached data for model definition specific data.
|
protected |
Map from instance unique ID to the index into myInstances for that instance.
|
protected |
Vector of per-view instance data buffers.
|
protected |
Map from model type names to template index.
|
protected |
Vector of instance processors.
Processors are run in order once per frame to update instance visibility/spatial data
|
protected |
List of active views.
Used to decide what buffers we need allocated/updated
|
protected |
Map from views to the group node that activates their instance buffer.
|
protected |
Map from geometry (drawable) to the callback that updates its start index uniform.
| makVrv::DtInstanceManager::DtInstanceManager | ( | DtDe & | de | ) |
CTOR.
|
virtual |
DTOR.
| bool makVrv::DtInstanceManager::intersect | ( | const osg::Vec3d & | start, |
| const osg::Vec3d & | end, | ||
| const osg::Vec3d & | reference, | ||
| DtOsgIntersectorResult & | result, | ||
| std::list< DtUniqueID > * | ignoreList = 0 |
||
| ) |
Find the closest instance intersection to the reference point along the line segment from start to end.
| bool makVrv::DtInstanceManager::intersect | ( | const osg::Vec3d & | start, |
| const osg::Vec3d & | end, | ||
| std::vector< DtOsgIntersectorResult > & | results, | ||
| std::list< DtUniqueID > * | ignoreList = 0 |
||
| ) |
Find the instance intersections to the start point along a line segment.
| void makVrv::DtInstanceManager::setSequenceMode | ( | const DtInstanceState & | instance, |
| unsigned int | sequenceIndex, | ||
| InstancedSequence::SequenceMode | mode | ||
| ) |
Set the playback mode for the specified sequence
| void makVrv::DtInstanceManager::setSequenceSpeed | ( | const DtInstanceState & | instance, |
| unsigned int | sequenceIndex, | ||
| float | speed | ||
| ) |
Set the playback speed for the specified sequence.
| void makVrv::DtInstanceManager::setSequencePlayTime | ( | const DtInstanceState & | instance, |
| unsigned int | sequenceIndex, | ||
| float | loopTime | ||
| ) |
Set the time the specified sequence should play for, starting now.
| InstanceMatrix makVrv::DtInstanceManager::dofState | ( | const DtInstanceState & | instanceState, |
| unsigned int | partIndex | ||
| ) |
Get the current transform matrix of an instanced articulated part
| void makVrv::DtInstanceManager::setDofState | ( | InstanceMatrix & | m, |
| const DtInstanceState & | state, | ||
| unsigned int | partIndex | ||
| ) |
Set the transform for the specified instanced DOF
| void makVrv::DtInstanceManager::setDofAnimation | ( | osg::Vec3f & | hpr, |
| const osg::Vec3f & | hprVel, | ||
| const DtInstanceState & | state, | ||
| unsigned int | partIndex | ||
| ) |
Set the DOF animation state for the specified instanced DOF.
| void makVrv::DtInstanceManager::setDofRotationalVelocity | ( | const osg::Vec3f & | hprVel, |
| const DtInstanceState & | state, | ||
| unsigned int | partIndex, | ||
| bool | forceUpdate = true |
||
| ) |
Set the DOF rotational velocity state for the specified instanced DOF.
| void makVrv::DtInstanceManager::setDofTranslation | ( | osg::Vec3f & | trans, |
| osg::Vec3f & | transVel, | ||
| const DtInstanceState & | state, | ||
| unsigned int | partIndex | ||
| ) |
Set the DOF translation state for the specified instanced DOF.
| void makVrv::DtInstanceManager::setSwitchState | ( | const DtInstanceState & | instance, |
| unsigned int | partIndex, | ||
| unsigned int | childIndex, | ||
| bool | state | ||
| ) |
Set the state of an instanced switch
| void makVrv::DtInstanceManager::setUVOffset | ( | DtUniqueID | id, |
| unsigned int | drawableIx, | ||
| unsigned int | count, | ||
| const osg::Vec2f & | uvOffset | ||
| ) |
Set the UV coordinate offset for a drawable
| void makVrv::DtInstanceManager::setUserDefined | ( | DtUniqueID | id, |
| float | userDefined | ||
| ) |
Set the user defined float for a drawable
| void makVrv::DtInstanceManager::setLightpointRange | ( | DtUniqueID | id, |
| float | range | ||
| ) |
Set the lightpoint range float for all lightpoints in an instance
| void makVrv::DtInstanceManager::setElementId | ( | DtUniqueID | id, |
| DtUniqueID | elementId | ||
| ) |
Set the element ID for an instanced model.
| osg::StateSet* makVrv::DtInstanceManager::getModelTypeRootStateSet | ( | const std::string & | modelType | ) |
Get the root state set for a particular type of model.
|
static |
Get an instance of the instance manager.
|
virtual |
Clear everything in the instance manager.
Deletes all current instances and instance templates
|
virtual |
Get the root node containing all instanced geometry.
| bool makVrv::DtInstanceManager::isRegistered | ( | const std::string & | modelType | ) |
Check whether a model is registered and ready for instancing.
| void makVrv::DtInstanceManager::registerModel | ( | const std::string & | modelType, |
| const ParserOutput & | parseOutput, | ||
| float | boundingRadius, | ||
| const DtVector & | boundingCenter, | ||
| unsigned int | nodeMask, | ||
| const osg::ref_ptr< osg::StateSet > & | rootNodeSS, | ||
| bool | daylightControlledLights = false |
||
| ) |
Register a model for instancing.
| osg::Geode* makVrv::DtInstanceManager::setupModelGeode | ( | const std::string & | modelType, |
| unsigned int | nodeMask | ||
| ) |
Set up a geode to contain instances of a model.
| void makVrv::DtInstanceManager::allocateImage | ( | const osg::View * | view | ) |
Allocate an instance texture for the specified view.
| void makVrv::DtInstanceManager::freeInstance | ( | DtUniqueID | id | ) |
Free the instance with the specified ID.
| void makVrv::DtInstanceManager::drainFreeInstanceList | ( | ) |
Free the instance with the specified ID in main thread.
| void makVrv::DtInstanceManager::setArtPartSmoothingEnabled | ( | bool | onOrOff | ) |
| bool makVrv::DtInstanceManager::artPartSmoothingEnabled | ( | ) | const |
| void makVrv::DtInstanceManager::setArtPartSmoothingPeriod | ( | float | period | ) |
| float makVrv::DtInstanceManager::artPartSmoothingPeriod | ( | ) | const |
| bool makVrv::DtInstanceManager::newInstance | ( | const std::string & | modelType, |
| DtUniqueID | id, | ||
| DtElementID | elementId, | ||
| short | modelSet, | ||
| DtModel * | model, | ||
| const std::string & | lightPointGroup, | ||
| bool | isSimpleModel | ||
| ) |
Set up a new instance of the specified model.
modelType should match a model that was registered previously with registerModel and id should be the id of the distributed object controlling the instance
| DtInstanceState* makVrv::DtInstanceManager::findInstanceState | ( | DtUniqueID | id | ) |
Find the specified instance's state.
Instance states may be rearranged in memory during allocation/deallocation, so this pointer is only valid for immediate use
| InstanceCullData* makVrv::DtInstanceManager::findInstanceCullData | ( | DtUniqueID | id | ) |
Find the culling data for the specified instance.
Cull data may be rearranged in memory during allocation/deallocation, so this pointer is only valid for immediate use
| void makVrv::DtInstanceManager::setPosition | ( | DtUniqueID | uniqueID, |
| const DtVector & | vPosition | ||
| ) |
Set Position and orientation off of Dt types.
| void makVrv::DtInstanceManager::setPositionOffset | ( | DtUniqueID | uniqueID, |
| const DtVector & | vPosition | ||
| ) |
| void makVrv::DtInstanceManager::setOrientation | ( | DtUniqueID | uniqueID, |
| const DtTaitBryan & | orientation | ||
| ) |
| void makVrv::DtInstanceManager::setOrientationOffset | ( | DtUniqueID | uniqueID, |
| const DtTaitBryan & | orientation | ||
| ) |
| void makVrv::DtInstanceManager::setPosition | ( | DtUniqueID | uniqueID, |
| const osg::Vec3d & | vPosition | ||
| ) |
Set Position and orientation off of osg types.
| void makVrv::DtInstanceManager::setPositionOffset | ( | DtUniqueID | uniqueID, |
| const osg::Vec3d & | vPosition | ||
| ) |
| void makVrv::DtInstanceManager::setOrientation | ( | DtUniqueID | uniqueID, |
| const osg::Quat & | orientation | ||
| ) |
| void makVrv::DtInstanceManager::setOrientationOffset | ( | DtUniqueID | uniqueID, |
| const osg::Quat & | orientation | ||
| ) |
| void makVrv::DtInstanceManager::setVisible | ( | DtUniqueID | uniqueID, |
| bool | bVisible | ||
| ) |
Set visibility.
| void makVrv::DtInstanceManager::setBlendColor | ( | DtUniqueID | uniqueID, |
| float | r, | ||
| float | g, | ||
| float | b, | ||
| float | a | ||
| ) |
Set the blending color.
| void makVrv::DtInstanceManager::setModelScaling | ( | DtUniqueID | uniqueID, |
| bool | bModelScaling, | ||
| float | scale | ||
| ) |
Set the model scaling /param uniqueID the ID of the model /param bModelScaling if global modelScaling is enabled /param scale the individual scale from the model definition, separate from the global scale.
| void makVrv::DtInstanceManager::setCullParameters | ( | DtUniqueID | uniqueID, |
| unsigned int | nodeMask, | ||
| bool | visible | ||
| ) |
Set the various culling parameters.
|
inline |
Element IDs of instances.
|
inline |
Scale of instances.
|
inline |
Visibility of instances in current view.
|
inline |
Spatial state of instanced drawables in current view.
|
inline |
Per instance cull data.
|
inline |
State of active instances.
|
inline |
UV Offset state of drawable instances.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Per model definition templates for creating instances.
|
inline |
Per-instance distances to eyepoint for the current camera.
|
inline |
Array of DOF animation data.
|
inline |
Last time the instances were updated.
|
inline |
Last cull parameters from the renderer.
|
inline |
Per instanced drawable visibility.
|
inline |
Camera position of the most recent camera that called update.
|
inline |
View that most recently called update.
|
inline |
Camera that was most recently used to udate.
Get the start index of the drawable spatial data for the specified instance.
Get the start index of the drawable spatial data for the specified instance.
|
inline |
Get the start index of the drawable spatial data for the specified instance.
References makVrv::ArrayRange::count, and makVrv::DtInstanceState::dofRange.
| void makVrv::DtInstanceManager::reloadShaders | ( | ) |
Reload instancing shaders.
|
inline |
|
virtual |
needed to run material callbacks
|
virtual |
needed to run animation callbacks
|
virtual |
update function for preparing the instance manger for an intersection used by the DtInstanceManager::instersect call to update the locations of the geometry if necessary (if it has not already been done for this frame by updateForDrawing) this does not update the light point drawables using the cull visitor like the updateForDrawing does.
|
virtual |
update function for preparing the instance manager for being drawn called once per view.
|
virtual |
Set the max distance for lightpoints.
Lightpoints will be culled at this distance if not 'small-feature' culled. If not set, and no max distance is set for the individual LightPointNode, then 20km is used
|
virtual |
Get the max distance for lightpoints.
|
virtual |
Lightpoint range is used to fade from max brightness (alpha = 1) to 0 at max range.
The lightpoint will be culled at the specified range, but the range used to reduce the alpha is biased by multiplying it by this value. This allows the user to tune the brightness at the point it is clipped to guarantee it is visible for the entire desired range
|
virtual |
Overridw the cull distance used in the instance manager.
|
virtual |
Get the distance used if culling override is enabled Set with the slider in the experimental features dialog.
|
virtual |
Returns proxy model definition name generated from the model definition.
Used to group models using texture skinning that share the same filename attribute into the same instance group.
| DtVirtualBaseClass* makVrv::DtInstanceManager::findCachedData | ( | const std::string & | modelType, |
| const std::string & | name | ||
| ) |
Lookup cached data.
The modelType and name are case sensitive.
| 0 | if no data is cached. |
| void makVrv::DtInstanceManager::setCachedData | ( | const std::string & | modelType, |
| const std::string & | name, | ||
| DtVirtualBaseClass * | data | ||
| ) |
Adds a data member to the cache.
If an existing data pointer is stored with key f(modelType, name) that key it is deleted. The modelType and name are case sensitive To delete cached data, pass a null pointer.
| void makVrv::DtInstanceManager::clearCachedData | ( | ) |
Clear previously allocated memory (to be called from the destructor)
| void makVrv::DtInstanceManager::releaseGLObjects | ( | osg::State * | state | ) |
| void makVrv::DtInstanceManager::updateBuffers | ( | const osg::View * | view | ) |
should only be called by the tbo updater in order to update the tbos
| void makVrv::DtInstanceManager::updateLightPoints | ( | const osg::Camera * | camera, |
| const osg::FrameStamp * | frameStamp, | ||
| osgUtil::CullVisitor * | cv, | ||
| const osg::Camera * | sceneCamera = NULL |
||
| ) |
loop over the light point nodes and send down the model view matrix for each instance.
only called by DtInstanceNode
| void makVrv::DtInstanceManager::addImguiStats | ( | ) | const |
added stats
| void makVrv::DtInstanceManager::resetTboSendFlag | ( | ) |
called by precull event
|
protected |
Update the instances.
Must be called once per frame per view for correct rendering. Updates in camera-relative coordinates, so the resulting drawables should be rendered with the view matrix's translation set to (0, 0, 0). The suppressLastUpdateTime parameter is used by intersect() to insure that myLastUpdateTime flag is not set for an intersect call that happens before the channels are updated (which would prevent updated camera-relative conversions for the new views).
|
protected |
Set up a geometry object for instanced rendering.
|
protected |
Compute the distance from an eyepoint to a point.
|
protected |
Apply any offsets to the instance and then update its distance from the eye point.
|
protected |
Apply any offsets to the instance and then update its distance from the eye point.
|
protected |
Resize myRenderList to fit the current set of instances and drawables.
|
protected |
Update the instance texture for the specified view.
|
protected |
Update the per-drawable render lists using the computed visibility and instance spatial data.
Returns the number of visible drawable instances for the current view
|
protected |
|
protected |
|
protected |
|
protected |
Allocate space for instance data that isn't contained in the instance struct itself, for the current number of instances.
Includes visibility set, scale factors, user defined floats, etc.
|
protected |
Fill the render list with data from the specified range of instances.
Returns the number of visible drawable instances for the current view
|
protected |
Frustum cull the specified range of instances.
|
protected |
Update per-view resources when a channel is added.
|
protected |
Clean up per-view resources when a channel is removed.
|
protected |
Clean up a single texture buffer object Uses a reference to a pointer since it can set instTbo = NULL.
|
protected |
Support function for intersect for generating list of hits.
|
protected |
reads the instance shaders from disk and attaches them to vp
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
initialize a new instance with it's group that it belongs to
|
protected |
|
protected |
|
protected |
|
protected |
Number of vec4 slots per instance in the instance data buffer.
| boost::signal<void(const std::string&)> makVrv::DtInstanceManager::signal_modelTypeRegistered |
Emitted when a new model type is registered with the instancing system.
| boost::signal<void(const std::string&, DtUniqueID, DtElementID, DtModel *)> makVrv::DtInstanceManager::signal_instanceCreated |
Emitted when a new instance of a model is added to the scene.
| boost::signal<void(const CullSet&)> makVrv::DtInstanceManager::signal_updateFinished |
Emitted when instance update is complete.
|
protected |
Per model definition templates for creating instances.
|
protected |
True when myRenderList needs to be resized.
|
protected |
|
protected |
Drawables in registered instance templates.
|
protected |
Per instanced drawable visibility state.
|
protected |
Spatial data for drawables in myDrawables.
Computed in camera relative coordinates per view
|
protected |
Per instance UV offsets.
|
protected |
Array of Per instance visibility state.
|
protected |
Per-instance distances to eyepoint for the current camera.
|
protected |
Array of per-instance model scale factors.
|
protected |
Array of per-instance user-defined floats.
|
protected |
Array of per-instance max lightpoint distances squared.
|
protected |
Array of per-instance culling data.
|
protected |
Array of per-instance element IDs.
|
protected |
|
protected |
|
protected |
list of nodes that have animated bits.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Array of DOF animation data.
|
protected |
Last time the instances were updated.
|
protected |
Camera position of the most recent camera that called update.
|
protected |
Reference to view that most recently called update.
|
protected |
Reference to the camera that most recently was used.
|
protected |
Storage for per-view cull set calculation.
|
protected |
|
protected |
Map model DtUniqueID to instance index into myInstances array.
|
protected |
|
protected |
|
protected |
|
protected |
Map model definition to its template index.
|
protected |
Number of UV offsets required by current allocated instances.
|
protected |
Map maximum number of instances for each template that we've allocated space for.
|
protected |
Map number of active instances per template.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Processors run after frustum culling.
|
protected |
Processors run before frustum culling.
|
protected |
|
protected |
|
protected |
|
protected |
Most recent active cull vistor parameters.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |