RTCHitN(3)
β¨ RTCHitN β¨
okay bestie, gather round, because today we're talking about RTCHitN β the hit packet of runtime size π no cap, that's literally the whole vibe.
πΈ SYNOPSIS πΈ
#include <embree3/rtcore.h>
struct HitN;
float& RTCHitN_Ng_x(RTCHitN* hit, unsigned int N, unsigned int i);
float& RTCHitN_Ng_y(RTCHitN* hit, unsigned int N, unsigned int i);
float& RTCHitN_Ng_z(RTCHitN* hit, unsigned int N, unsigned int i);
float& RTCHitN_u(RTCHitN* hit, unsigned int N, unsigned int i);
float& RTCHitN_v(RTCHitN* hit, unsigned int N, unsigned int i);
unsigned& RTCHitN_primID(RTCHitN* hit, unsigned int N, unsigned int i);
unsigned& RTCHitN_geomID(RTCHitN* hit, unsigned int N, unsigned int i);
unsigned& RTCHitN_instID(RTCHitN* hit, unsigned int N, unsigned int i, unsigned int level);
like, the whole cast is right there π«Ά go off.
π DESCRIPTION π
so here's the tea π β sometimes the hit packet size just isn't known at compile time. like, it's giving mystery. that happens when Embree hands you a hit packet inside the RTCFilterFuncN callback function. in those moments, Embree uses the RTCHitN type for hit packets, and that's just how it is, periodt.
and here's the important bit, bestie, don't skip this: these hit packets can only have sizes of 1, 4, 8, or 16. no other packet size will be used. that's it. that's the list. π₯
so you've got two whole options, pick your main character energy:
- implement different special code paths for each of those possible packet sizes, and cast the hit to the appropriate hit packet type β very β¨ bespoke β¨ of you
- implement one general code path that uses the
RTCHitN_XXXhelper functions to access hit packet components β lowkey the chill option, highkey efficient π¦
now, how do these helper functions work? they take:
- a pointer to the hit packet β that's the
hitargument π - the packet size β that's the
Nargument π«
β¦and they return a reference to a component (like the x component of Ng) of the the i-th hit of the packet β and i is, you guessed it, the i argument π
so like. pointer in, size in, reference out. it's giving functional. it's giving elegant. iykyk π
π EXIT STATUS π
(nothing here bestie, it's empty, we move on π)
π SEE ALSO π
- [
RTCRayN]
that's the whole page, babe β icon status achieved π β¨
signing off with love from the Embree Ray Tracing Kernels 3 era, page RTCHitN(3), dated right there in the footer like a lil timestamp on the group chat π«Ά
π¦ where this page comes from
- epel 9: embree 3.13.5-4.el9 Β· Apache-2.0
- fedora 43: embree3 3.13.5-9.fc41 Β· Apache-2.0
- fedora 44: embree3 3.13.5-16.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms