VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions
makVrv::DtIndirectDofManager Class Reference

handles the dof nodes for all the indirect geometry. More...

Inheritance diagram for makVrv::DtIndirectDofManager:
Inheritance graph
[legend]

Classes

struct  IndirectDofInfoInvalidator
 initializer/invalidator for dof infos More...
 
struct  IndirectDofInfoRemovalPredicate
 removal predicate to know which dof infos belong to the same instance More...
 

Public Types

typedef osg::observer_ptr
< osg::Node > 
NodeObserverPtr
 
typedef std::pair
< NodeObserverPtr,
DtIndirectDofInfo
NodeDofInfoPair
 
typedef std::pair
< NodeObserverPtr, int
NodeDofInfoIndexPair
 
typedef std::deque
< NodeDofInfoPair
DequeNodeDofInfoPairs
 
typedef std::unordered_map
< int, DtIndirectAnimatingDof * > 
MapInfoIdxToAnimatingDof
 
typedef std::unordered_map
< int, int
MapInstanceIdToDofInfo
 
typedef std::map< osg::ref_ptr
< osgSim::DOFTransform >
, MapInstanceIdToDofInfo
MapNodeToMapInstanceIdToDofInfoIndex
 
- Public Types inherited from makVrv::DtIndirectManager
enum  ManagerTypes {
  BaseClass, LodManager, SwitchManager, DofManager,
  UvOffsetManager, PerInstanceDataManager
}
 

Public Member Functions

virtual ~DtIndirectDofManager ()
 DTOR. More...
 
virtual void addDofPaths (int perGeomInstanceIndex, int size, const DequeNodeDofInfoPairs &parentDofPaths, const DequeNodeDofInfoPairs &dofPaths, int instanceId, float modelScale, float modelRadius)
 Add a list of dof paths to the dof manager. Once added they are connected to the signal or called directly, so that changes can be passed down to the indirect buffer. More...
 
virtual void removeDofPaths (int instanceId)
 remove the dof paths/infos associated with an instance More...
 
virtual void setDof (osgSim::DOFTransform *clone, osgSim::DOFTransform *master, int instanceId)
 set the dof state of an instance/clone, with an instance id. More...
 
virtual void setDofTranslation (osgSim::DOFTransform *clone, osgSim::DOFTransform *master, int instanceId, const Vector3_64 &trans, const Vector3_64 &transVel)
 set the translation and translation velocity for a particular instance of a particular dof More...
 
virtual void setDofOrientation (osgSim::DOFTransform *clone, osgSim::DOFTransform *master, int instanceId, const Vector3_64 &hpr, const Vector3_64 &hprVel)
 set the HPR (heading, pitch and roll) & HPR velocity for a particular instance of a particular dof More...
 
virtual void setDofOrientation (osgSim::DOFTransform *clone, osgSim::DOFTransform *master, int instanceId, const Vector3_64 &hprVel, bool forceUpdate)
 set the HPR velocity for a particular instance of a particular dof More...
 
virtual void setDofTransform (IndirectDofInfo &info, const osgSim::DOFTransform *clone)
 set the dof transform for a particular instance of a particular dof More...
 
virtual void setInstanceXform (const Matrix4_32 &xform, int instanceId)
 set the top level instance transform for an instance More...
 
virtual Matrix4_32 instanceXform (int instanceId) const
 get the top level instance transform for an instance More...
 
virtual void update (const osg::FrameStamp *frameStamp)
 update dofs when pure signal based dof is true, this function does nothing More...
 
virtual void setPureSignalBasedDofs (bool val)
 indicate whether this manager's dofs get updated per frame via looking at the actual dofs or directly using signals More...
 
virtual bool pureSignalBasedDofs (void) const
 indicate whether this manager's dofs get updated per frame via looking at the actual dofs or directly using signals More...
 
virtual void reloadShaders () const
 reload shaders More...
 
virtual void releaseGLObjects (osg::State *state) const
 clean up gl More...
 
virtual void processDofs (const DtIndirectViewParameters &viewParameters, const DtGlBuffer *gpuInputPerGeomInstancesBuffer, const DtGlBuffer *gpuMaterialsBuffer, const osg::Camera *camera)
 setup and run the dof compute shader which calculates all the dof transform matrices More...
 
virtual const DtGlBuffergpuDofTransformBuffer (const osg::Camera *camera) const
 Buffer containing the final transforms per geom instance id. More...
 
virtual const DtGlBuffergpuDofModelScaleBuffer (const osg::Camera *camera) const
 Buffer containing the model scales per geom instance id used by the lod and the light point vs. More...
 
- Public Member Functions inherited from makVrv::DtIndirectManager
 DtIndirectManager (DtDe &de, DtInstanceContainer &container)
 CTOR. More...
 
virtual ~DtIndirectManager ()
 DTOR. More...
 

Public Attributes

friend DtIndirectDofManagerCreator
 only creator can create More...
 

Protected Types

typedef std::map
< osg::observer_ptr< const
osg::Camera >, DtGlBuffer * > 
CameraToBufferMap
 
typedef DtReusableMemoryVector
< IndirectDofInfo,
IndirectDofInfoInvalidator,
IndirectDofInfoRemovalPredicate
VectorIndirectDofInfos
 

Protected Member Functions

 DtIndirectDofManager (DtDe &de, DtInstanceContainer &container)
 CTOR. only creator can create. More...
 
virtual void addDof (int perGeomInstanceIndex, const NodeDofInfoPair &dofChildPair, int instanceId, int baseParentDofIndex, const int dofInfoId, const float modelScale, const float modelRadius)
 Adds a single dof for a single per geometry instance. More...
 
virtual void updateAnimatingDofs (const osg::FrameStamp *frameStamp)
 update dofs More...
 
virtual void deleteBuffers (void)
 delete the GPU buffers More...
 
virtual void tearDownBuffers (void) const
 delete the GPU buffers but leave the CPU objects that hold the buffers alone. More...
 
virtual void updateDofBuffersIfNecessary ()
 if the dof buffers are dirty then update them More...
 
virtual void deleteShaders () const
 delete the compute shader program More...
 
virtual void updateDofs ()
 update all the dofs managed by this manager More...
 
virtual bool findDofInfoIndex (osgSim::DOFTransform *clone, osgSim::DOFTransform *master, int instanceId, int &infoIdx)
 find the dof info index for a given clone in an instance returns true if succeeded. More...
 
virtual DtIndirectAnimatingDoffindOrCreateAnimatingDof (int infoIdx, osgSim::DOFTransform *dof)
 find or create an animating dof for this dof info index for this dof More...
 
virtual void printInfo ()
 print out the info of what's contained in the maps More...
 
virtual void flushCameraSpecificBuffers (void)
 model scale buffer and dof xform buffers are camera specific check to see if any cameras are no longer valid and destroy their buffers if they are invalid. More...
 
virtual void createCameraSpecificBuffersIfNeeded (const osg::Camera *camera)
 model scale buffer and dof xform buffers are camera specific create them for the current camera if needed More...
 

Protected Attributes

bool myPureSignalBasedDofs
 
DtIndirectDofProgrammyMutableDofProgram
 
DtGlBuffermyGpuDofInfoBuffer
 The buffer containing all the dof infos for all instances managed by this manager. More...
 
CameraToBufferMap myGpuDofTransformBufferMap
 The buffer containing the transform for each instance to know where it should be drawn. More...
 
CameraToBufferMap myGpuDofModelScaleBufferMap
 The output buffer containing the computed model scale for each geom instance. More...
 
bool myMutableDofInfoDirty
 
unsigned int myMaxPerGeomInstanceId
 
MapNodeToMapInstanceIdToDofInfoIndex myMapNodeToMapInstanceIdToDofInfoIndex
 
VectorIndirectDofInfos myVectorIndirectDofInfos
 
std::unordered_map< int, intmyInstanceToXformBaseIndex
 
MapInfoIdxToAnimatingDof myAnimatingDofs
 
- Protected Attributes inherited from makVrv::DtIndirectManager
DtInstanceContainermyInstanceContainer
 
DtDemyDe
 

Private Member Functions

 DtIndirectDofManager ()=delete
 default constructor not implemented More...
 
 DtIndirectDofManager (const DtIndirectDofManager &other)=delete
 Copy Constructor not implemented – Copy Not Allowed. More...
 
DtIndirectDofManageroperator= (const DtIndirectDofManager &other)=delete
 Assignment Operator Not implemented – Assignment Not Allowed. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from makVrv::DtIndirectManager
static int managerType ()
 what type of manager is this class More...
 

Detailed Description

handles the dof nodes for all the indirect geometry.

Sets up the default state of osg::Dof. runs a compute shader held by a DtIndirectDofProgram for processing the dofs for every per geometry per instance Owned by a DtIndirectGeometry 1:1

Member Typedef Documentation

typedef osg::observer_ptr<osg::Node> makVrv::DtIndirectDofManager::NodeObserverPtr
typedef std::map<osg::observer_ptr<const osg::Camera>, DtGlBuffer*> makVrv::DtIndirectDofManager::CameraToBufferMap
protected

Constructor & Destructor Documentation

virtual makVrv::DtIndirectDofManager::~DtIndirectDofManager ( )
virtual

DTOR.

makVrv::DtIndirectDofManager::DtIndirectDofManager ( DtDe de,
DtInstanceContainer container 
)
protected

CTOR. only creator can create.

makVrv::DtIndirectDofManager::DtIndirectDofManager ( )
privatedelete

default constructor not implemented

makVrv::DtIndirectDofManager::DtIndirectDofManager ( const DtIndirectDofManager other)
privatedelete

Copy Constructor not implemented – Copy Not Allowed.

Member Function Documentation

DtIndirectDofManager& makVrv::DtIndirectDofManager::operator= ( const DtIndirectDofManager other)
privatedelete

Assignment Operator Not implemented – Assignment Not Allowed.

virtual void makVrv::DtIndirectDofManager::addDofPaths ( int  perGeomInstanceIndex,
int  size,
const DequeNodeDofInfoPairs parentDofPaths,
const DequeNodeDofInfoPairs dofPaths,
int  instanceId,
float  modelScale,
float  modelRadius 
)
virtual

Add a list of dof paths to the dof manager. Once added they are connected to the signal or called directly, so that changes can be passed down to the indirect buffer.

virtual void makVrv::DtIndirectDofManager::removeDofPaths ( int  instanceId)
virtual

remove the dof paths/infos associated with an instance

virtual void makVrv::DtIndirectDofManager::setDof ( osgSim::DOFTransform *  clone,
osgSim::DOFTransform *  master,
int  instanceId 
)
virtual

set the dof state of an instance/clone, with an instance id.

The representative 'master' that is in the indirect dof manager is the parameter 'master'

virtual void makVrv::DtIndirectDofManager::setDofTranslation ( osgSim::DOFTransform *  clone,
osgSim::DOFTransform *  master,
int  instanceId,
const Vector3_64 trans,
const Vector3_64 transVel 
)
virtual

set the translation and translation velocity for a particular instance of a particular dof

virtual void makVrv::DtIndirectDofManager::setDofOrientation ( osgSim::DOFTransform *  clone,
osgSim::DOFTransform *  master,
int  instanceId,
const Vector3_64 hpr,
const Vector3_64 hprVel 
)
virtual

set the HPR (heading, pitch and roll) & HPR velocity for a particular instance of a particular dof

virtual void makVrv::DtIndirectDofManager::setDofOrientation ( osgSim::DOFTransform *  clone,
osgSim::DOFTransform *  master,
int  instanceId,
const Vector3_64 hprVel,
bool  forceUpdate 
)
virtual

set the HPR velocity for a particular instance of a particular dof

virtual void makVrv::DtIndirectDofManager::setDofTransform ( IndirectDofInfo &  info,
const osgSim::DOFTransform *  clone 
)
virtual

set the dof transform for a particular instance of a particular dof

virtual void makVrv::DtIndirectDofManager::setInstanceXform ( const Matrix4_32 xform,
int  instanceId 
)
virtual

set the top level instance transform for an instance

virtual Matrix4_32 makVrv::DtIndirectDofManager::instanceXform ( int  instanceId) const
virtual

get the top level instance transform for an instance

virtual void makVrv::DtIndirectDofManager::update ( const osg::FrameStamp *  frameStamp)
virtual

update dofs when pure signal based dof is true, this function does nothing

virtual void makVrv::DtIndirectDofManager::setPureSignalBasedDofs ( bool  val)
virtual

indicate whether this manager's dofs get updated per frame via looking at the actual dofs or directly using signals

virtual bool makVrv::DtIndirectDofManager::pureSignalBasedDofs ( void  ) const
virtual

indicate whether this manager's dofs get updated per frame via looking at the actual dofs or directly using signals

virtual void makVrv::DtIndirectDofManager::reloadShaders ( ) const
virtual

reload shaders

virtual void makVrv::DtIndirectDofManager::releaseGLObjects ( osg::State *  state) const
virtual

clean up gl

virtual void makVrv::DtIndirectDofManager::processDofs ( const DtIndirectViewParameters viewParameters,
const DtGlBuffer gpuInputPerGeomInstancesBuffer,
const DtGlBuffer gpuMaterialsBuffer,
const osg::Camera *  camera 
)
virtual

setup and run the dof compute shader which calculates all the dof transform matrices

virtual const DtGlBuffer* makVrv::DtIndirectDofManager::gpuDofTransformBuffer ( const osg::Camera *  camera) const
virtual

Buffer containing the final transforms per geom instance id.

virtual const DtGlBuffer* makVrv::DtIndirectDofManager::gpuDofModelScaleBuffer ( const osg::Camera *  camera) const
virtual

Buffer containing the model scales per geom instance id used by the lod and the light point vs.

virtual void makVrv::DtIndirectDofManager::addDof ( int  perGeomInstanceIndex,
const NodeDofInfoPair dofChildPair,
int  instanceId,
int  baseParentDofIndex,
const int  dofInfoId,
const float  modelScale,
const float  modelRadius 
)
protectedvirtual

Adds a single dof for a single per geometry instance.

virtual void makVrv::DtIndirectDofManager::updateAnimatingDofs ( const osg::FrameStamp *  frameStamp)
protectedvirtual

update dofs

virtual void makVrv::DtIndirectDofManager::deleteBuffers ( void  )
protectedvirtual

delete the GPU buffers

virtual void makVrv::DtIndirectDofManager::tearDownBuffers ( void  ) const
protectedvirtual

delete the GPU buffers but leave the CPU objects that hold the buffers alone.

virtual void makVrv::DtIndirectDofManager::updateDofBuffersIfNecessary ( )
protectedvirtual

if the dof buffers are dirty then update them

virtual void makVrv::DtIndirectDofManager::deleteShaders ( ) const
protectedvirtual

delete the compute shader program

virtual void makVrv::DtIndirectDofManager::updateDofs ( )
protectedvirtual

update all the dofs managed by this manager

virtual bool makVrv::DtIndirectDofManager::findDofInfoIndex ( osgSim::DOFTransform *  clone,
osgSim::DOFTransform *  master,
int  instanceId,
int infoIdx 
)
protectedvirtual

find the dof info index for a given clone in an instance returns true if succeeded.

infoIdx contains the index returns false if failed. infoIdx contains -1

virtual DtIndirectAnimatingDof* makVrv::DtIndirectDofManager::findOrCreateAnimatingDof ( int  infoIdx,
osgSim::DOFTransform *  dof 
)
protectedvirtual

find or create an animating dof for this dof info index for this dof

virtual void makVrv::DtIndirectDofManager::printInfo ( )
protectedvirtual

print out the info of what's contained in the maps

virtual void makVrv::DtIndirectDofManager::flushCameraSpecificBuffers ( void  )
protectedvirtual

model scale buffer and dof xform buffers are camera specific check to see if any cameras are no longer valid and destroy their buffers if they are invalid.

virtual void makVrv::DtIndirectDofManager::createCameraSpecificBuffersIfNeeded ( const osg::Camera *  camera)
protectedvirtual

model scale buffer and dof xform buffers are camera specific create them for the current camera if needed

Member Data Documentation

friend makVrv::DtIndirectDofManager::DtIndirectDofManagerCreator

only creator can create

bool makVrv::DtIndirectDofManager::myPureSignalBasedDofs
protected
DtIndirectDofProgram* makVrv::DtIndirectDofManager::myMutableDofProgram
mutableprotected
DtGlBuffer* makVrv::DtIndirectDofManager::myGpuDofInfoBuffer
protected

The buffer containing all the dof infos for all instances managed by this manager.

CameraToBufferMap makVrv::DtIndirectDofManager::myGpuDofTransformBufferMap
protected

The buffer containing the transform for each instance to know where it should be drawn.

CameraToBufferMap makVrv::DtIndirectDofManager::myGpuDofModelScaleBufferMap
protected

The output buffer containing the computed model scale for each geom instance.

This is used by the lod processor

bool makVrv::DtIndirectDofManager::myMutableDofInfoDirty
mutableprotected
unsigned int makVrv::DtIndirectDofManager::myMaxPerGeomInstanceId
protected
MapNodeToMapInstanceIdToDofInfoIndex makVrv::DtIndirectDofManager::myMapNodeToMapInstanceIdToDofInfoIndex
protected
VectorIndirectDofInfos makVrv::DtIndirectDofManager::myVectorIndirectDofInfos
protected
std::unordered_map<int, int> makVrv::DtIndirectDofManager::myInstanceToXformBaseIndex
protected
MapInfoIdxToAnimatingDof makVrv::DtIndirectDofManager::myAnimatingDofs
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)