![]() |
VR-Forces Developer's Guide
|
singleton class that acts as a bridge between the

Classes | |
| struct | DtLightPointGroupInfo |
| struct | ModelVariantInformation |
Public Member Functions | |
| virtual | ~DtOsgIndirectEntityManager () |
| virtual bool | addInstance (DtUniqueID uniqueId, const DtModelDefinition &modelDefinition, const DtOsgModelInstance &modelInstance, DtModel *model, DtModelSetId modelSet, float modelScale, float modelRadius, bool daylightControlled, bool mapDofsSwitchesSequences, const DtLightPointGroupInfo &lightPointGroupInfo, bool trackLifeTime, const std::string &trackName) |
| virtual bool | addInstanceAsProp (DtUniqueID uniqueId, const DtModelDefinition &modelDefinition, const DtOsgModelInstance &modelInstance, DtModel *model, float modelScale, float modelRadius, bool daylightControlled, bool mapDofsSwitchesSequences, int lightPointGroupId) |
| virtual bool | hasInstance (DtUniqueID uniqueId) const |
| virtual void | removeInstance (DtUniqueID uniqueID) |
| virtual int | numInstances (void) const |
| virtual void | mapMultiSwitches (DtUniqueID uniqueID, DtArticulatedModelParser::MapStateNumberToMultiSwitchList &multiSwitchesOfInstance) |
| virtual void | unMapMultiSwitches (DtUniqueID uniqueID) |
| virtual void | mapSequences (DtUniqueID uniqueID, DtArticulatedModelParser::AnimationMap &animationMap) |
| virtual void | unMapSequences (DtUniqueID uniqueID) |
| virtual void | mapDofs (DtUniqueID uniqueID, DtArticulatedModelParser::PartMap &partMap) |
| virtual void | unMapDofs (DtUniqueID uniqueID) |
| virtual void | setMultiSwitchActiveSwitchSet (DtUniqueID id, osgSim::MultiSwitch *multiSwitchOfInstance) |
| virtual void | setSequenceUpdate (DtUniqueID uniqueID, osg::Sequence *dof) |
| virtual void | setUvOffsetUpdate (DtUniqueID uniqueID, const std::string &annotation, float uOffset, float vOffset) |
| virtual void | scrollUvTextures (DtUniqueID uniqueID, const std::tuple< float, float, float > &uvspeeds) |
| virtual void | setDofUpdate (DtUniqueID uniqueID, osgSim::DOFTransform *dof) |
| virtual void | setDofAnimationFlags (DtUniqueID uniqueID, osgSim::DOFTransform *dof, int animationFlags) |
| virtual void | setDofTranslation (DtUniqueID uniqueID, osgSim::DOFTransform *dof, const Vector3_64 &trans, const Vector3_64 &transVel) |
| virtual void | setDofOrientation (DtUniqueID uniqueID, osgSim::DOFTransform *dof, const Vector3_64 &hpr, const Vector3_64 &hprVel, int animationFlags) |
| virtual void | setDofOrientation (DtUniqueID uniqueID, osgSim::DOFTransform *dof, const Vector3_64 &hprVel, bool forceUpdate, int animationFlags) |
| virtual void | setDofOrientationBatch (DtUniqueID uniqueID, const std::vector< DtDofOrientationBatchEntry > &entries) |
| void | slot_atcGlobalModelEnableChanged () |
| virtual void | setPositionAndOrientation (DtUniqueID uniqueId, const DtVector &position, const DtTaitBryan &orientation, const DtVector &positionOffset, const DtTaitBryan &orientationOffset) |
| virtual void | setColor (DtUniqueID uniqueId, const Vector4_32 &color) |
| virtual void | setOtherData0 (DtUniqueID uniqueId, const Vector4_32 &data) |
| virtual void | setVisible (DtUniqueID uniqueId, bool visible) |
| virtual void | setLightPointGroupId (DtUniqueID uniqueId, int groupId) |
| virtual void | setLightPointMaxDistance (DtUniqueID uniqueId, float maxDistance) |
| virtual void | tick (void) override |
| virtual void | slot_releaseResources () |
| virtual void | slot_postTick () |
| virtual void | slot_postInit () |
| virtual void | excludeTextureFromLimits (const std::string &textureFileAbolutePath) |
| virtual void | excludeModelDefinitionFromLimits (const std::string &modelDefinition) |
| virtual DtIndirectLimitTextureStrategy * | limitTextureStrategy (DtModelSetId modelSet) |
| virtual bool | isCopyingData (void) const |
| virtual void | setCellPageOutTime (double val) |
| virtual double | cellPageOutTime (void) const |
| virtual bool | areRegisteredModelTextureVariants (DtModelSetId modelSet, const std::string &fileName) const |
| virtual void | registerModelTextureVariants (DtModelSetId modelSet, const DtModelDefinition *modelDefinition, const std::vector< std::string > &variantPaths) |
| virtual void | setModelTextureVariant (DtUniqueID uniqueId, const std::string &variant) |
Public Member Functions inherited from makVrv::DtIndirectEntityManager | |
| virtual | ~DtIndirectEntityManager () |
| DtIndirectEntityManager ()=delete | |
| DtIndirectEntityManager (const DtIndirectEntityManager &)=delete | |
| DtIndirectEntityManager & | operator= (const DtIndirectEntityManager &)=delete |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| virtual | ~DtVirtualBaseClass () |
Static Public Member Functions | |
| static void | registerInstance (DtDe &de) |
| static DtOsgIndirectEntityManager & | instance (DtDe &de) |
Static Public Member Functions inherited from makVrv::DtIndirectEntityManager | |
| static DtIndirectEntityManager & | instance (DtDe &de) |
Public Attributes | |
Signals | |
| boost::signalslib::signal < void(DtModel *, DtUniqueID)> | signal_instanceAdded |
Protected Member Functions | |
| DtOsgIndirectEntityManager (DtDe &de) | |
| DtOsgIndirectEntityManager ()=delete | |
| DtOsgIndirectEntityManager (const DtOsgIndirectEntityManager &)=delete | |
| DtOsgIndirectEntityManager & | operator= (const DtOsgIndirectEntityManager &)=delete |
| virtual int | addInstanceWithPageOutRetry (DtIndirectGeometryGrid *grid, const Vector3_int &cellId, DtIndirectEntityGeometry *&indirectGeometry, int modelId, float modelScale, float modelRadius, int lightPointGroupId, bool trackLifeTime, const std::string &trackName, bool defaultVisibility) |
| virtual DtIndirectEntityManagerInstanceMoveInfo * | createMoveInfoIfNecessary (const DtVector &position, DtIndirectEntityManagerInstance ¤tEntityManagerInstance, DtUniqueID uniqueId) |
| virtual osgSim::DOFTransform * | findMasterDof (DtUniqueID uniqueID, osgSim::DOFTransform *dof) const |
| virtual DtIndirectEntityGeometry * | findIndirectGeometryAndInstanceId (DtUniqueID uniqueID, int &instanceId) const |
| virtual void | calculateAndSetInstanceMatrixTransform (const DtVector &position, const DtTaitBryan &orientation, const DtVector &positionOffset, const DtTaitBryan &orientationOffset, DtIndirectEntityGeometry *indirectGeometry, int instanceId) |
| virtual void | reset () |
| virtual void | tickEntityMoves (void) |
| virtual void | tickPaging (void) |
| virtual bool | instanceIsBeingMovedTo (const Vector3_int &cellId) |
| void | setupRootNodes () |
| virtual void | setupReductionExcludeTextures () |
| virtual void | updateStats () |
| virtual void | disableModelSet (DtModelSetId modelSet) |
| virtual bool | modelSetDisabled (DtModelSetId modelSet) const |
| virtual void | setAlpha2Coverage (osg::Node *node, bool on) |
| virtual void | clearMasterMappingsMap (void) |
| virtual bool | parseNodeAndRegisterMasterMappings (osg::Node *modelNodeMaster, const std::string &modelName) |
Protected Member Functions inherited from makVrv::DtIndirectEntityManager | |
| DtIndirectEntityManager (DtDe &de) | |
|
protected |
There is one grid per model set type in the manager Each grid contains a list of 'cells' Each cell contains an indirect geometry each indirect geometry contains a number of instances.
|
protected |
map of unique ids to the corresponding DtOsgIndirectEntityManagerInstances
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
move info for the instances being moved Use concurrent hash map here as it supports concurrent erase with locking accessors
|
protected |
A map that holds all indirect geometries in one location so that they can be ticked, and this can be done across multiple threads. Use unordered map here as it supports concurrent traversal and insertion but does not support concurrent erase. Removal from this map only occurs in DtOsgIndirectEntityManager::tickPaging() which is single threaded.
|
protected |
map of inactive cells to their start and current time
|
protected |
map of each grid (model set) to inactive cells in that grid
|
virtual |
destructor
|
protected |
constructor. protected. only creator can create
|
protecteddelete |
private default constructor. not allowed.
|
protecteddelete |
prevent copy-construction
|
static |
Register an instance DtOsgIndirectEntityManager on DtDe.
|
static |
Get an instance of the instance manager Throws if none found.
|
protecteddelete |
prevent assignment
|
virtual |
add an instance returns true if the instance was added. false if the model was unable to be added like there is no renderable geometry in the model
|
virtual |
add an instance as a prop. This just calls addInstance with a model set of -1 under the hood. Props are added to the prop root and rendered in all observer modes. returns true if the instance was added.
|
virtual |
check whether an instance with this id exists.
|
virtual |
remove an instance
|
virtual |
number of instances added to our manager
|
virtual |
A model instance multi switches & sequences have the same hierarchy/positions as the original model (or first instance) because its cloned (so that per-entity switches/multi-switches can be manipulated on a per-instance basis) Indirect geometry maintains a list of the original/master switches from the original model in the same hierarchy This function is needed to be called so that it will map an instance multi-switches to the 'master' multi-switches We use the first instance as the 'master'.
|
virtual |
unmap previously mapped switches of the model instance
|
virtual |
Similarly, map sequences.
|
virtual |
unmap previously mapped sequences
|
virtual |
Similarly, dofs.
|
virtual |
unmap previously mapped dofs
|
virtual |
set the multi-switch state on a multi-switch of an instance
|
virtual |
set sequence update
|
virtual |
set the uv offset for a particular model and annotation
|
virtual |
set the uv offset for a particular model and all the scrollable ids
|
virtual |
map sequences
|
virtual |
set the animation flags of a dof
|
virtual |
set the translation and translation velocity on a dof
|
virtual |
set the HPR (heading, pitch and roll) & HPR velocity on a dof
|
virtual |
set the HPR velocity on a dof
|
virtual |
Set HPR velocity on multiple DOFs in a single batch.
Resolves the DOF-to-master map and indirect geometry once, then forwards all entries to the geometry layer as a batch.
| uniqueID | Entity whose DOFs are being updated. |
| entries | Vector of per-DOF velocity entries to apply. |
| void makVrv::DtOsgIndirectEntityManager::slot_atcGlobalModelEnableChanged | ( | ) |
Slot to handle the global alpha to coverage signal for entities Called by constructor so can't be virtual.
|
virtual |
update the position and orientation of a particular model instance.
|
virtual |
set the color modulator of a particular model instance.
|
virtual |
set the otherData0 of a particular model instance.
|
virtual |
set the visibility of a particular model instance.
|
virtual |
set the light point group id of a particular model instance.
|
virtual |
set the max distance for a light point of a particular model instance
|
virtual |
set/get the page out time of the cells cells get paged out/deleted after they have been inactive for this period of time in seconds. default value is 60 seconds val passed in should be > 0
|
virtual |
set/get the page out time of the cells cells get paged out/deleted after they have been inactive for this period of time in seconds. default value is 60 seconds val passed in should be > 0
|
overridevirtual |
Calls processUpdates on all indirect geometries in myIndirectEntityGeometryMap in parallel Calls processInstanceTrackingRequests for all indirect grids.
Implements makVrv::DtIndirectEntityManager.
|
virtual |
This slot is called when the last window is destroyed from the renderer. This will be called on a master or RDE. On an RDE in particular, this is called as a result of DtDe::reset when the RDE is disconnected from a master. The RDE reset case is handled here to reset this manager.
|
virtual |
handle the postTick signal. This -moves entities, if they are ready to be moved -pages out indirect geometries with 0 entities/instances
|
virtual |
Once the renderer has been created we can initialize this object on post init.
|
virtual |
exclude a texture from limits.
|
virtual |
exclude all of a model's textures from limits.
|
virtual |
limit texture strategy for a model set (grid)
|
virtual |
Whether internally the models are being processed/loaded (whether registrar is copying/processing models)
|
virtual |
register model texture variants
|
virtual |
register model texture variants
|
virtual |
register model texture variants
|
protectedvirtual |
Add an instance to the indirect geometry for a cell, retrying once if the geometry was shut down (paged out) between the caller's lookup and the add.
DtIndirectGeometry::addInstance returns -1 when the geometry's shutdown flag is set (see tickPaging). In that case this method re-fetches the cell from the grid - which recreates it - registers the new geometry in myIndirectEntityGeometryMap if needed, and retries. A fresh cell cannot be paged out for at least cellPageOutTime seconds of inactivity, so a single retry is sufficient by construction; no instance can be lost.
| grid | The grid owning the cell. |
| cellId | The cell to add the instance to. |
| indirectGeometry | In: the geometry the caller looked up. Out: the geometry the instance actually landed in (may differ after a retry). |
| modelId,modelScale,modelRadius,lightPointGroupId,trackLifeTime,trackName,defaultVisibility | Forwarded to DtIndirectGeometry::addInstance. |
|
protectedvirtual |
See if we are moving from old cell to new cell for this position If we are, returns the move info to do this move.
|
protectedvirtual |
get the master dof for a unique id and clone dof
|
protectedvirtual |
find the indirect geometry for a given unique id
|
protectedvirtual |
utility function for calculating the instance matrix transform for a paricular instance in an indirect geometry.
|
protectedvirtual |
Releases all resources and resets book-keeping associated with this manager, essentially resetting the manager.
|
protectedvirtual |
update entity moves
|
protectedvirtual |
page out entities that have had 0 instances for page time seconds
|
protectedvirtual |
whether a cell figures in move info being moved to
|
protected |
not virtual because it is called by the constructor. Sets up the geometry grids with the root nodes.
|
protectedvirtual |
read the textures to exclude from reduction from the csv file and add them to the limiting strategies of each model set
|
protectedvirtual |
called in post tick to update the indirect entity related stats.
|
protectedvirtual |
disable a model set grid completely (for debugging)
|
protectedvirtual |
disable a model set grid completely (for debugging)
|
protectedvirtual |
internal
|
protectedvirtual |
internal
|
protectedvirtual |
internal
| boost::signalslib::signal<void(DtModel*, DtUniqueID)> makVrv::DtOsgIndirectEntityManager::signal_instanceAdded |
Emitted when a new instance of a model is added to the entity manager.
|
protected |
manager for connections
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Container for moves that need to be deleted. The DTOR for DtOsgIndirectEntityManagerInstanceMoveInfo is not thread safe, do not pop from the queue from multiple threads. This Container is cleared from tickPaging.
|
protected |
|
protected |
map of each grid (model set) to inactive cells in that grid
|
protected |
|
protected |
|
protected |
Reusable vector for resolved DOF batch entries. Cleared each call, preserves capacity. Main-thread only – not thread-safe.
|
protected |
|
protected |