.\" Automatically generated by Pandoc 3.1.11.1 .\" .TH "RTCRay" "3" "" "" "Embree Ray Tracing Kernels 4" .SS NAME .IP .EX RTCRay \- single ray structure .EE .SS SYNOPSIS .IP .EX #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 }; .EE .SS DESCRIPTION The \f[CR]RTCRay\f[R] structure defines the ray layout for a single ray. The ray contains the origin (\f[CR]org_x\f[R], \f[CR]org_y\f[R], \f[CR]org_z\f[R] members), direction vector (\f[CR]dir_x\f[R], \f[CR]dir_y\f[R], \f[CR]dir_z\f[R] members), and ray segment (\f[CR]tnear\f[R] and \f[CR]tfar\f[R] members). The ray direction does not have to be normalized, and only the parameter range specified by the \f[CR]tnear\f[R]/\f[CR]tfar\f[R] interval is considered valid. .PP The ray segment must be in the range [0, ∞], 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, 1] (\f[CR]time\f[R] member), a ray mask (\f[CR]mask\f[R] member), a ray ID (\f[CR]id\f[R] member), and ray flags (\f[CR]flags\f[R] member). The ray mask can be used to mask out some geometries for some rays (see \f[CR]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[CR]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[CR]RTCRay4\f[R] type), size 8 (\f[CR]RTCRay8\f[R] type), and size 16 (\f[CR]RTCRay16\f[R] type). The header additionally defines an \f[CR]RTCRayNt\f[R] template for ray packets of an arbitrary compile\-time size. .SS EXIT STATUS .SS SEE ALSO [RTCHit]