rtcInitPo...ryContext(3)
π NAME π
rtcInitPointQueryContext β bestie, this is the one that sets up your context info (like, the stack of (multilevel-)instance transformations) for point queries β¨
π SYNOPSIS π
#include <embree4/rtcore.h>
struct RTC_ALIGN(16) RTCPointQueryContext
{
// accumulated 4x4 column major matrices from world to instance space.
float world2inst[RTC_MAX_INSTANCE_LEVEL_COUNT][16];
// accumulated 4x4 column major matrices from instance to world space.
float inst2world[RTC_MAX_INSTANCE_LEVEL_COUNT][16];
// instance ids.
unsigned int instID[RTC_MAX_INSTANCE_LEVEL_COUNT];
// number of instances currently on the stack.
unsigned int instStackSize;
};
void rtcInitPointQueryContext(
struct RTCPointQueryContext* context
);
πΈ DESCRIPTION πΈ
Okay so picture a stack β and it's literally the RTCPointQueryContext type β that holds onto the IDs and the instance transformations while a BVH traversal is happening for a point query. The way that these transformations are assumed to be affine transformations (that's a 3Γ3 matrix plus a translation, iykyk) means the last column just gets ignored, no cap. (peep [RTC_GEOMETRY_TYPE_INSTANCE] if you want the deets π)
The rtcInitPointContext function initializes the context to its default values, and bestie, you should be calling it for initialization. That's the vibe check. π
So the context gets passed as an argument to the point query callback function (see [rtcSetGeometryPointQueryFunction]) and you're gonna use it to pass instance information down the instancing chain for user defined instancing β the tutorial [ClosestPoint] has a reference implementation of point queries with user defined instancing if you want to see it done right π«Ά
And lowkey important: the context is a necessary argument to [rtcPointQuery]. Embree internally grabs the topmost instance transformation off the stack to transform the point query into instance space. Main character transformation behavior fr fr β¨
π EXIT STATUS π
No error code is set by this function. Zero drama, zero errors, iconic behavior. π
π SEE ALSO π
- [rtcPointQuery]
- [rtcSetGeometryPointQueryFunction]
okay that's the whole page bestie, go forth and init your context π This was rtcInitPo...ryContext(3) from Embree Ray Tracing Kernels 4 β mwah, stan, bye ππ¦
π¦ where this page comes from
- alpine 3.24: embree-doc 4.4.1-r0 Β· Apache-2.0
- arch rolling: embree 4.4.1-1 Β· Apache-2.0
- fedora 43: embree 4.4.1-1.fc43 Β· Apache-2.0
- fedora 44: embree 4.4.1-1.fc44 Β· Apache-2.0
- nixpkgs unstable: embree 4.4.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms