VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtVortexPagedTerrainProducer Class Reference

Detailed Description

This class manages the terrain being inserted into the Vortex universe, maintaining a collection of paged cells with collision geometries. It also handles dynamic terrain within Vortex.

#include <vortexPagedTerrainProducer.h>

Inheritance diagram for makVre::DtVortexPagedTerrainProducer:
[legend]

Classes

struct  PagedCell
 

Public Types

using PagedCells = std::unordered_map<int, PagedCell*>
 

Public Member Functions

 DtVortexPagedTerrainProducer ()
 
virtual ~DtVortexPagedTerrainProducer () override
 
virtual void preStep () override
 
void insertTerrain (int sourceId, int requestId, VxMath::BoundingBox requestBounds, Vx::VxCollisionGeometry *cg)
 
void insertTerrain (int sourceId, int requestId)
 
PagedCellgetPagedCellForSourceID (int sourceId)
 
PagedCells getPagedCells ()
 
virtual std::vector< Vx::VxCollisionGeometry * > getAllCollisionGeometries ()
 
bool isTerrainAvailable (const VxMath::Vector3 &inputCords)
 
void setTerrainCellSize (double cellSize)
 
double getTerrainCellSize () const
 

Protected Member Functions

virtual void _initialize () override
 

Protected Attributes

double myPagedTerrainCellSize
 
PagedCells myPagedCells
 
tbb::spin_mutex myInsertMutex
 

Member Typedef Documentation

◆ PagedCells

Map type for storing paged cells indexed by source ID.

Constructor & Destructor Documentation

◆ DtVortexPagedTerrainProducer()

makVre::DtVortexPagedTerrainProducer::DtVortexPagedTerrainProducer ( )

Constructor.

Initializes a new terrain producer with default settings.

◆ ~DtVortexPagedTerrainProducer()

virtual makVre::DtVortexPagedTerrainProducer::~DtVortexPagedTerrainProducer ( )
overridevirtual

Destructor.

Cleans up terrain cells and resources.

Member Function Documentation

◆ preStep()

virtual void makVre::DtVortexPagedTerrainProducer::preStep ( )
overridevirtual

Performs pre-step operations.

Gets collision geometries of parts, maps terrain requests, and sets request priorities before stepping. Also manages the PagedCells being tracked.

◆ insertTerrain() [1/2]

void makVre::DtVortexPagedTerrainProducer::insertTerrain ( int sourceId,
int requestId,
VxMath::BoundingBox requestBounds,
Vx::VxCollisionGeometry * cg )

Inserts terrain with new collision geometry.

Adds the specified parts and collision geometries to the area of a given request with the received source ID. Use when the terrain element is not already present. Also inserts this into the myPagedCells map.

Parameters
sourceIdSource ID to link this collision geometry to
requestIdRequest ID to link this collision geometry to
requestBoundsRequest bounds of this terrain request
cgCollision geometry to insert

◆ insertTerrain() [2/2]

void makVre::DtVortexPagedTerrainProducer::insertTerrain ( int sourceId,
int requestId )

Inserts terrain with existing source ID.

Calls default insertTerrain where a request ID shares the same source ID as another request.

Parameters
sourceIdSource ID to link this collision geometry to
requestIdRequest ID to link this collision geometry to

◆ getPagedCellForSourceID()

PagedCell * makVre::DtVortexPagedTerrainProducer::getPagedCellForSourceID ( int sourceId)

Gets the paged cell for a source ID.

Parameters
sourceIdThe source ID to look up
Returns
Pointer to the paged cell, or nullptr if not found

◆ getPagedCells()

PagedCells makVre::DtVortexPagedTerrainProducer::getPagedCells ( )

Gets all paged cells.

Returns
Map of all paged cells indexed by source ID

◆ getAllCollisionGeometries()

virtual std::vector< Vx::VxCollisionGeometry * > makVre::DtVortexPagedTerrainProducer::getAllCollisionGeometries ( )
virtual

Gets all collision geometries.

Returns
Vector of all collision geometries in the terrain

◆ isTerrainAvailable()

bool makVre::DtVortexPagedTerrainProducer::isTerrainAvailable ( const VxMath::Vector3 & inputCords)

Checks if terrain is available below coordinates.

Parameters
inputCordsPosition to check for terrain
Returns
True if terrain exists below the coordinates, false otherwise

◆ setTerrainCellSize()

void makVre::DtVortexPagedTerrainProducer::setTerrainCellSize ( double cellSize)

Sets the terrain cell size.

Parameters
cellSizeThe new cell size in meters

◆ getTerrainCellSize()

double makVre::DtVortexPagedTerrainProducer::getTerrainCellSize ( ) const

Gets the terrain cell size.

Returns
The current cell size in meters

◆ _initialize()

virtual void makVre::DtVortexPagedTerrainProducer::_initialize ( )
overrideprotectedvirtual

Initializes the paged terrain producer.

Internal method called during initialization.

Member Data Documentation

◆ myPagedTerrainCellSize

double makVre::DtVortexPagedTerrainProducer::myPagedTerrainCellSize
protected

Size of terrain cells in meters.

◆ myPagedCells

PagedCells makVre::DtVortexPagedTerrainProducer::myPagedCells
protected

Map of all paged cells by source ID.

◆ myInsertMutex

tbb::spin_mutex makVre::DtVortexPagedTerrainProducer::myInsertMutex
protected

Mutex for thread-safe insertion.


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