1% RTCRay(3) | Embree Ray Tracing Kernels 3
2
3#### NAME
4
5    RTCRay - single ray structure
6
7#### SYNOPSIS
8
9    #include <embree3/rtcore_ray.h>
10
11    struct RTC_ALIGN(16) RTCRay
12    {
13      float org_x;        // x coordinate of ray origin
14      float org_y;        // y coordinate of ray origin
15      float org_z;        // z coordinate of ray origin
16      float tnear;        // start of ray segment
17
18      float dir_x;        // x coordinate of ray direction
19      float dir_y;        // y coordinate of ray direction
20      float dir_z;        // z coordinate of ray direction
21      float time;         // time of this ray for motion blur
22
23      float tfar;         // end of ray segment (set to hit distance)
24      unsigned int mask;  // ray mask
25      unsigned int id;    // ray ID
26      unsigned int flags; // ray flags
27    };
28
29#### DESCRIPTION
30
31The `RTCRay` structure defines the ray layout for a single ray. The
32ray contains the origin (`org_x`, `org_y`, `org_z` members), direction
33vector (`dir_x`, `dir_y`, `dir_z` members), and ray segment (`tnear`
34and `tfar` members). The ray direction does not have to be normalized,
35and only the parameter range specified by the `tnear`/`tfar` interval
36is considered valid.
37
38The ray segment must be in the range $[0, \infty]$, thus ranges that
39start behind the ray origin are not allowed, but ranges can reach to
40infinity. For rays inside a ray stream, `tfar` < `tnear` identifies
41an inactive ray.
42
43The ray further contains a motion blur time in the range $[0, 1]$
44(`time` member), a ray mask (`mask` member), a ray ID (`id` member),
45and ray flags (`flags` member). The ray mask can be used to mask out
46some geometries for some rays (see `rtcSetGeometryMask` for more
47details). The ray ID can be used to identify a ray inside a callback
48function, even if the order of rays inside a ray packet or stream has
49changed. The ray flags are reserved.
50
51The `embree3/rtcore_ray.h` header additionally defines the same ray
52structure in structure of array (SOA) layout for API functions
53accepting ray packets of size 4 (`RTCRay4` type), size 8 (`RTCRay8`
54type), and size 16 (`RTCRay16` type). The header additionally defines
55an `RTCRayNt` template for ray packets of an arbitrary compile-time
56size.
57
58#### EXIT STATUS
59
60#### SEE ALSO
61
62[RTCHit]
63