.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "RTCRay" "3" "" "" "Embree Ray Tracing Kernels 4" .hy .SS NAME .IP .nf \f[C] RTCRay - single ray structure \f[R] .fi .SS SYNOPSIS .IP .nf \f[C] #include struct RTC_ALIGN(16) RTCRay { float org_x; // x coordinate of ray origin float org_y; // y coordinate of ray origin float org_z; // z coordinate of ray origin float tnear; // start of ray segment float dir_x; // x coordinate of ray direction float dir_y; // y coordinate of ray direction float dir_z; // z coordinate of ray direction float time; // time of this ray for motion blur float tfar; // end of ray segment (set to hit distance) unsigned int mask; // ray mask unsigned int id; // ray ID unsigned int flags; // ray flags }; \f[R] .fi .SS DESCRIPTION .PP The \f[C]RTCRay\f[R] structure defines the ray layout for a single ray. The ray contains the origin (\f[C]org_x\f[R], \f[C]org_y\f[R], \f[C]org_z\f[R] members), direction vector (\f[C]dir_x\f[R], \f[C]dir_y\f[R], \f[C]dir_z\f[R] members), and ray segment (\f[C]tnear\f[R] and \f[C]tfar\f[R] members). The ray direction does not have to be normalized, and only the parameter range specified by the \f[C]tnear\f[R]/\f[C]tfar\f[R] interval is considered valid. .PP The ray segment must be in the range [0,\[u2006]\[if]], thus ranges that start behind the ray origin are not allowed, but ranges can reach to infinity. .PP The ray further contains a motion blur time in the range [0,\[u2006]1] (\f[C]time\f[R] member), a ray mask (\f[C]mask\f[R] member), a ray ID (\f[C]id\f[R] member), and ray flags (\f[C]flags\f[R] member). The ray mask can be used to mask out some geometries for some rays (see \f[C]rtcSetGeometryMask\f[R] for more details). The ray ID can be used to identify a ray inside a callback function, even if the order of rays inside a ray packet has changed. .PP The \f[C]embree4/rtcore_ray.h\f[R] header additionally defines the same ray structure in structure of array (SOA) layout for API functions accepting ray packets of size 4 (\f[C]RTCRay4\f[R] type), size 8 (\f[C]RTCRay8\f[R] type), and size 16 (\f[C]RTCRay16\f[R] type). The header additionally defines an \f[C]RTCRayNt\f[R] template for ray packets of an arbitrary compile-time size. .SS EXIT STATUS .SS SEE ALSO .PP [RTCHit]