Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-12 08:27:09

0001 #pragma once
0002 
0003 #include <math.h>
0004 
0005 #include "OpticksGenstep.h"
0006 #include "SRG.h"
0007 
0008 #if defined(__CUDACC__) || defined(__CUDABE__)
0009 #define CSGOPTIX7_HELPER_METHOD __device__ __forceinline__
0010 #else
0011 #define CSGOPTIX7_HELPER_METHOD inline
0012 #endif
0013 
0014 CSGOPTIX7_HELPER_METHOD bool CSGOptiX7_GenstepCarriesMaterialLine(unsigned gentype)
0015 {
0016     return gentype == OpticksGenstep_CERENKOV ||
0017            gentype == OpticksGenstep_SCINTILLATION ||
0018            gentype == OpticksGenstep_G4Cerenkov_modified;
0019 }
0020 
0021 CSGOPTIX7_HELPER_METHOD float CSGOptiX7_ReportedIntersectionDistance(
0022     float    distance,
0023     unsigned raygenmode,
0024     float    direction_dot_normal)
0025 {
0026     const bool defer_exit = raygenmode == SRG_SIMULATE && direction_dot_normal > 0.f;
0027     return defer_exit ? nextafterf(distance, INFINITY) : distance;
0028 }
0029 
0030 #undef CSGOPTIX7_HELPER_METHOD