NVIDIA OptiX 6.5 API nvidia_logo_transpbg.gif Up
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Ray Struct Reference

Public Attributes

float3 origin
 
float3 direction
 
unsigned int ray_type
 
float tmin
 
float tmax
 

Detailed Description

Ray class.

Description

Ray is an encapsulation of a ray mathematical entity. The origin and direction members specify the ray, while the ray_type member specifies which closest-hit/any-hit pair will be used when the ray hits a geometry object. The tmin/tmax members specify the interval over which the ray is valid.

To avoid numerical range problems, the value RT_DEFAULT_MAX can be used to specify an infinite extent.

During C++ compilation, Ray is contained within the optix:: namespace but has global scope during C compilation. Ray's constructors are not available during C compilation.

Members

// The origin of the ray
float3 origin;
// The direction of the ray
float3 direction;
// The ray type associated with this ray
unsigned int ray_type;
// The min and max extents associated with this ray
float tmin;
float tmax;

Constructors

// Create a Ray with undefined member values
Ray( void );
// Create a Ray copied from an exemplar
Ray( const Ray &r );
// Create a ray with a specified origin, direction, ray_type, and min/max extents.
// When tmax is not given, it defaults to @ref RT_DEFAULT_MAX.
Ray( float3 origin, float3 direction, unsigned int ray_type,
float tmin, float tmax = RT_DEFAULT_MAX);

Functions

// Create a ray with a specified origin, direction, ray type, and min/max extents.
Ray make_Ray( float3 origin,
float3 direction,
unsigned int ray_type,
float tmin,
float tmax );

History

Ray was introduced in OptiX 1.0.

See also rtContextSetRayTypeCount, rtMaterialSetAnyHitProgram, rtMaterialSetClosestHitProgram

Member Data Documentation

float3 Ray::direction

The direction of the ray

float3 Ray::origin

The origin of the ray

unsigned int Ray::ray_type

The ray type associated with this ray

float Ray::tmax

The max extent associated with this ray

float Ray::tmin

The min extent associated with this ray