chrono::sensor::ChOptixEngine Class Reference

Description

Optix Engine that is responsible for managing all render-based sensors.

The is the interface between the dynamic simulation and the rendering/ray tracing. All ray tracing code is setup and managed via this class.

#include <ChOptixEngine.h>

Public Member Functions

 ChOptixEngine (ChSystem *sys, int device_id, int max_scene_reflections=9, bool verbose=false)
 Class constructor. More...
 
 ~ChOptixEngine ()
 Class destructor.
 
void AssignSensor (std::shared_ptr< ChOptixSensor > sensor)
 Add a sensor for this engine to manage and update. More...
 
void UpdateSensors (std::shared_ptr< ChScene > scene)
 Updates the sensors if they need to be updated based on simulation time and last update time. More...
 
void ConstructScene ()
 Tells the optix manager to construct the scene from scratch, translating all objects from Chrono to Optix.
 
int GetDevice ()
 Way to query the device ID on which the engine is running. More...
 
int GetNumSensor ()
 Query the number of sensors for which this engine is responsible. More...
 
std::vector< std::shared_ptr< ChOptixSensor > > GetSensor ()
 Gives the user the optix context. More...
 

Constructor & Destructor Documentation

◆ ChOptixEngine()

chrono::sensor::ChOptixEngine::ChOptixEngine ( ChSystem sys,
int  device_id,
int  max_scene_reflections = 9,
bool  verbose = false 
)

Class constructor.

Parameters
sysPointer to the ChSystem that defines the simulation
device_idThe id of the GPU which this engine is running on
max_scene_reflectionsThe maximum number of ray recursions that should be allowed by this engine
verboseSets verbose level for the engine

Member Function Documentation

◆ AssignSensor()

void chrono::sensor::ChOptixEngine::AssignSensor ( std::shared_ptr< ChOptixSensor sensor)

Add a sensor for this engine to manage and update.

Parameters
sensorA shared pointer to an Optix-based sensor

◆ GetDevice()

int chrono::sensor::ChOptixEngine::GetDevice ( )
inline

Way to query the device ID on which the engine is running.

CANNOT BE MODIFIED since the engine will have been already constructed

Returns
the GPU ID

◆ GetNumSensor()

int chrono::sensor::ChOptixEngine::GetNumSensor ( )
inline

Query the number of sensors for which this engine is responsible.

Returns
The number of sensors managed by this engine

◆ GetSensor()

std::vector<std::shared_ptr<ChOptixSensor> > chrono::sensor::ChOptixEngine::GetSensor ( )
inline

Gives the user the optix context.

This should be used with caution and should not be required for typical simulations.

Returns
The Optix context Gives the user access to the list of sensors being managed by this engine.
the vector of Chrono sensors

◆ UpdateSensors()

void chrono::sensor::ChOptixEngine::UpdateSensors ( std::shared_ptr< ChScene scene)

Updates the sensors if they need to be updated based on simulation time and last update time.

Parameters
sceneThe scene that should be rendered with.

The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_sensor/optix/ChOptixEngine.h
  • /builds/uwsbel/chrono/src/chrono_sensor/optix/ChOptixEngine.cpp