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

Manages a bunch of 'cells' for a given cell size (similar to a sparse octree) each cell has a. More...

Public Types

typedef std::unordered_map
< Vector3_int, osg::ref_ptr
< DtIndirectGeometry >
, DtIndirectCellHasher
MapCellIdsToIndirectGeometry
 
typedef std::unordered_map
< Vector3_int, osg::ref_ptr
< osg::Drawable >
, DtIndirectCellHasher
MapCellIdsToDebugCellDrawables
 

Public Member Functions

 DtIndirectGeometryGrid (DtDe &de)
 CTOR. More...
 
virtual ~DtIndirectGeometryGrid ()
 DTOR. More...
 
virtual DtIndirectGeometryts_getOrCreateForCell (const Vector3_int &cellId, bool &created)
 get an indirect geometry for this cell, or create one created parameter indicates whether this was created anew Called by the background update tickables which run in parallel so this function has a mutex in order to be thread safe More...
 
virtual bool ts_removeCell (const Vector3_int &cellId)
 remove a cell and indirect geometry for the given cell More...
 
virtual Vector3_int cellIdFor (const Vector3_64 &position) const
 get the cell id for a given position More...
 
virtual Vector3_64 cellCenter (const Vector3_int &cellId) const
 get the cell center of a given cell More...
 
virtual AxisAlignedBoundingBox_64 GetAxisAlignedBoundingBox (const Vector3_int &cellId) const
 get AABB More...
 
virtual AxisAlignedBoundingBox_64 GetAxisAlignedBoundingBoxWithPadding (const Vector3_int &cellId) const
 get AABB with padding More...
 
virtual DtIndirectModelsContainermodelsContainer ()
 get the internal models' container More...
 
virtual osg::ref_ptr< osg::Node > gridNode ()
 get the underlying top level grid node that is the parent of the indirect geometries More...
 
virtual const
MapCellIdsToIndirectGeometry
mapCellIdsToIndirectGeometry (void) const
 get the map of cell ids to indirect geometries More...
 
virtual const
MapCellIdsToDebugCellDrawables
mapCellIdsToDebugCellDrawables (void) const
 get the map of cell ids to indirect geometries (const version) More...
 
virtual void setCellSize (const Vector3_64 &cellSize)
 set/get the cell size More...
 
virtual const Vector3_64cellSize (void) const
 
virtual void setCellPadding (const Vector3_64 &padding)
 set/get the cell padding. More...
 
virtual const Vector3_64cellPadding (void) const
 

Protected Attributes

DtDemyDe
 reference to DtDe More...
 
osg::ref_ptr< osg::Node > myGridNode
 
MapCellIdsToIndirectGeometry myMapCellIdsToIndirectGeometry
 
MapCellIdsToDebugCellDrawables myMapCellIdsToDebugCellDrawables
 
DtIndirectModelsContainermyModelsContainer
 
Vector3_64 myCellSize
 the cell size More...
 
Vector3_64 myCellPadding
 the cell 'padding' More...
 
boost::mutex myMapCellIdsToIndirectGeometryMutex
 

Private Member Functions

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

Detailed Description

Manages a bunch of 'cells' for a given cell size (similar to a sparse octree) each cell has a.

See Also
DtIndirectGeometry associated with it if it has at least one entity in it.
DtIndirectGeometryGridNode is the osg::Node derrived object which manages traversal and sets up the indirect geometries for cull/draw Each cell is the same size in world space and is an axis aligned cube (or rectangular prizm if the cell size is not the same for all components) Contains a
DtIndirectModelsContainer object which contains the shared
DtIndirectRegistrar for keeping the unique model information. All
DtIndirectGeometry object held by this grid use the same registrar in order to avoid duplication of the unique model data (verts/colors/textures/etc).

Member Typedef Documentation

Constructor & Destructor Documentation

makVrv::DtIndirectGeometryGrid::DtIndirectGeometryGrid ( DtDe de)

CTOR.

virtual makVrv::DtIndirectGeometryGrid::~DtIndirectGeometryGrid ( )
virtual

DTOR.

makVrv::DtIndirectGeometryGrid::DtIndirectGeometryGrid ( )
privatedelete

default constructor not implemented

makVrv::DtIndirectGeometryGrid::DtIndirectGeometryGrid ( const DtIndirectGeometryGrid other)
privatedelete

Copy Constructor not implemented – Copy Not Allowed.

Member Function Documentation

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

Assignment Operator Not implemented – Assignment Not Allowed.

virtual DtIndirectGeometry* makVrv::DtIndirectGeometryGrid::ts_getOrCreateForCell ( const Vector3_int cellId,
bool created 
)
virtual

get an indirect geometry for this cell, or create one created parameter indicates whether this was created anew Called by the background update tickables which run in parallel so this function has a mutex in order to be thread safe

virtual bool makVrv::DtIndirectGeometryGrid::ts_removeCell ( const Vector3_int cellId)
virtual

remove a cell and indirect geometry for the given cell

virtual Vector3_int makVrv::DtIndirectGeometryGrid::cellIdFor ( const Vector3_64 position) const
virtual

get the cell id for a given position

virtual Vector3_64 makVrv::DtIndirectGeometryGrid::cellCenter ( const Vector3_int cellId) const
virtual

get the cell center of a given cell

virtual AxisAlignedBoundingBox_64 makVrv::DtIndirectGeometryGrid::GetAxisAlignedBoundingBox ( const Vector3_int cellId) const
virtual

get AABB

virtual AxisAlignedBoundingBox_64 makVrv::DtIndirectGeometryGrid::GetAxisAlignedBoundingBoxWithPadding ( const Vector3_int cellId) const
virtual

get AABB with padding

virtual DtIndirectModelsContainer* makVrv::DtIndirectGeometryGrid::modelsContainer ( )
virtual

get the internal models' container

virtual void makVrv::DtIndirectGeometryGrid::setCellSize ( const Vector3_64 cellSize)
virtual

set/get the cell size

virtual const Vector3_64& makVrv::DtIndirectGeometryGrid::cellSize ( void  ) const
virtual
virtual void makVrv::DtIndirectGeometryGrid::setCellPadding ( const Vector3_64 padding)
virtual

set/get the cell padding.

If an entity position is out of a cell (as determined by cellIdFor(), then we can further determine if its still in the old cell expanded with this padding. This is useful for retaining the entity within an old cell, if they flip/flop on the edges of 2 cells (e.g. buoys)

virtual const Vector3_64& makVrv::DtIndirectGeometryGrid::cellPadding ( void  ) const
virtual
virtual osg::ref_ptr<osg::Node> makVrv::DtIndirectGeometryGrid::gridNode ( )
virtual

get the underlying top level grid node that is the parent of the indirect geometries

virtual const MapCellIdsToIndirectGeometry& makVrv::DtIndirectGeometryGrid::mapCellIdsToIndirectGeometry ( void  ) const
virtual

get the map of cell ids to indirect geometries

virtual const MapCellIdsToDebugCellDrawables& makVrv::DtIndirectGeometryGrid::mapCellIdsToDebugCellDrawables ( void  ) const
virtual

get the map of cell ids to indirect geometries (const version)

Member Data Documentation

DtDe& makVrv::DtIndirectGeometryGrid::myDe
protected

reference to DtDe

osg::ref_ptr<osg::Node> makVrv::DtIndirectGeometryGrid::myGridNode
protected
MapCellIdsToIndirectGeometry makVrv::DtIndirectGeometryGrid::myMapCellIdsToIndirectGeometry
protected
MapCellIdsToDebugCellDrawables makVrv::DtIndirectGeometryGrid::myMapCellIdsToDebugCellDrawables
protected
DtIndirectModelsContainer* makVrv::DtIndirectGeometryGrid::myModelsContainer
protected
Vector3_64 makVrv::DtIndirectGeometryGrid::myCellSize
protected

the cell size

Vector3_64 makVrv::DtIndirectGeometryGrid::myCellPadding
protected

the cell 'padding'

boost::mutex makVrv::DtIndirectGeometryGrid::myMapCellIdsToIndirectGeometryMutex
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)