chrono::sensor::ChOptixGeometry Class Reference

Description

Optix Geometry class that is responsible for managing all geometric information in the optix scene This handles the acceleration structure and transforms.

#include <ChOptixGeometry.h>

Public Member Functions

 ChOptixGeometry (OptixDeviceContext context)
 Class constructor. More...
 
 ~ChOptixGeometry ()
 Class destructor.
 
void AddBox (std::shared_ptr< ChBody > body, ChFrame< double > asset_frame, ChVector< double > scale, unsigned int mat_id)
 Add a box geometry to the optix scene. More...
 
void AddSphere (std::shared_ptr< ChBody > body, ChFrame< double > asset_frame, ChVector< double > scale, unsigned int mat_id)
 Add a sphere geometry to the optix scene. More...
 
void AddCylinder (std::shared_ptr< ChBody > body, ChFrame< double > asset_frame, ChVector< double > scale, unsigned int mat_id)
 Add a cylinder geometry to the optix scene. More...
 
unsigned int AddRigidMesh (CUdeviceptr d_vertices, CUdeviceptr d_indices, std::shared_ptr< ChTriangleMeshShape > mesh_shape, std::shared_ptr< ChBody > body, ChFrame< double > asset_frame, ChVector< double > scale, unsigned int mat_id)
 Add a rigid mesh to the optix scene. More...
 
void AddDeformableMesh (CUdeviceptr d_vertices, CUdeviceptr d_indices, std::shared_ptr< ChTriangleMeshShape > mesh_shape, std::shared_ptr< ChBody > body, ChFrame< double > asset_frame, ChVector< double > scale, unsigned int mat_id)
 Add a deformable mesh to the optix scene. More...
 
OptixTraversableHandle CreateRootStructure ()
 Create the root node and acceleration structure of the scene. More...
 
void RebuildRootStructure ()
 Rebuild the root acceleration structure for when the root changes.
 
void UpdateBodyTransformsStart (float t_start, float t_target_end)
 Update the list of transforms associated with the bodies and assets at the start time.
 
void UpdateBodyTransformsEnd (float t_end)
 Update the list of transforms associated with the bodies and assets at the end time.
 
void UpdateDeformableMeshes ()
 Update the deformable meshes based on how the meshes changed in Chrono.
 
void Cleanup ()
 Cleanup the entire optix geometry manager, cleans and frees device pointers and root structure.
 
void SetOriginOffset (ChVector< float > origin_offset)
 Origin offset function for moving the origin to reduce large translations.
 

Constructor & Destructor Documentation

◆ ChOptixGeometry()

chrono::sensor::ChOptixGeometry::ChOptixGeometry ( OptixDeviceContext  context)

Class constructor.

Parameters
contextoptix context for which the ChOptixGeometry maintains the scene

Member Function Documentation

◆ AddBox()

void chrono::sensor::ChOptixGeometry::AddBox ( std::shared_ptr< ChBody body,
ChFrame< double >  asset_frame,
ChVector< double >  scale,
unsigned int  mat_id 
)

Add a box geometry to the optix scene.

Parameters
bodythe Chrono Body that drives the box
asset_framethe Chrono frame that specifies how the asset is attached to the body
scalethe scale of the box
mat_idthe material id associated with the box

◆ AddCylinder()

void chrono::sensor::ChOptixGeometry::AddCylinder ( std::shared_ptr< ChBody body,
ChFrame< double >  asset_frame,
ChVector< double >  scale,
unsigned int  mat_id 
)

Add a cylinder geometry to the optix scene.

Parameters
bodythe Chrono Body that drives the cylinder
asset_framethe Chrono frame that specifies how the asset is attached to the body
scalethe scale of the cylinder
mat_idthe material id associated with the cylinder

◆ AddDeformableMesh()

void chrono::sensor::ChOptixGeometry::AddDeformableMesh ( CUdeviceptr  d_vertices,
CUdeviceptr  d_indices,
std::shared_ptr< ChTriangleMeshShape mesh_shape,
std::shared_ptr< ChBody body,
ChFrame< double >  asset_frame,
ChVector< double >  scale,
unsigned int  mat_id 
)

Add a deformable mesh to the optix scene.

Parameters
d_verticesa device pointer to the vertices of the mesh
d_indicesa device pointer to the indices of the mesh
mesh_shapethe Chrono mesh shape that defines the mesh
bodythe Chrono body on which the mesh is attached
asset_framethe Chrono frame that specifies how the asset is attached to the body
scalethe scale of the mesh
mat_idthe material id associated with the mesh

◆ AddRigidMesh()

unsigned int chrono::sensor::ChOptixGeometry::AddRigidMesh ( CUdeviceptr  d_vertices,
CUdeviceptr  d_indices,
std::shared_ptr< ChTriangleMeshShape mesh_shape,
std::shared_ptr< ChBody body,
ChFrame< double >  asset_frame,
ChVector< double >  scale,
unsigned int  mat_id 
)

Add a rigid mesh to the optix scene.

Parameters
d_verticesa device pointer to the vertices of the mesh
d_indicesa device pointer to the indices of the mesh
mesh_shapethe Chrono mesh shape that defines the mesh
bodythe Chrono body on which the mesh is attached
asset_framethe Chrono frame that specifies how the asset is attached to the body
scalethe scale of the mesh
mat_idthe material id associated with the mesh

◆ AddSphere()

void chrono::sensor::ChOptixGeometry::AddSphere ( std::shared_ptr< ChBody body,
ChFrame< double >  asset_frame,
ChVector< double >  scale,
unsigned int  mat_id 
)

Add a sphere geometry to the optix scene.

Parameters
bodythe Chrono Body that drives the sphere
asset_framethe Chrono frame that specifies how the asset is attached to the body
scalethe scale of the sphere
mat_idthe material id associated with the sphere

◆ CreateRootStructure()

OptixTraversableHandle chrono::sensor::ChOptixGeometry::CreateRootStructure ( )

Create the root node and acceleration structure of the scene.

Returns
A traversable handle to the root node

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