In implementing multiple closest_hit_radiance() programs the same thing is being done in the beginning of each one, namely the transformation of the normals returned by the intersection program from OBJECT coordinates to WORLD coordinates. I would like to refactor the calls to rtTransformNormal() to a single function in a header and then have each program include the header file and call the common code. I tried this, including <optix.h> and <optixu/optixu_math_namespace.h> in my header file (the same includes in my closest hit programs), but I get compile errors:
error C2065: ‘RT_OBJECT_TO_WORLD’ : undeclared identifier
error C3861: ‘rtTransformNormal’: identifier not found
Is there a way to do this without running into compile problems when the library changes in the future?
Thanks in advance.