rtcInitPo...ryContext(3)

πŸ“¦ version 3.13.5, in epel 9, fedora 43, fedora 44

πŸ’– NAME πŸ’–

rtcInitPointQueryContext β€” bestie, this one initializes the context info (like, the stack of (multilevel-)instance transformations, yes those) for point queries ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <embree3/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 the RTCPointQueryContext type, no cap β€” that keeps hold of the IDs and the instance transformations while a BVH traversal is happening for a point query. It's giving very organized. πŸ’…

The transformations are assumed to be affine transformations (that's a 3Γ—3 matrix plus a translation, iykyk), and therefore the last column is ignored (peep [RTC_GEOMETRY_TYPE_INSTANCE] for the deets).

The rtcInitPointContext function initializes the context to default values, and bestie, you should fr fr call it for initialization. Don't skip it. πŸ™ˆ

The context gets passed as an argument to the point query callback function (check [rtcSetGeometryPointQueryFunction]) and should be used 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, go look πŸ‘€).

Also? The context is a necessary argument to [rtcPointQuery] β€” like, mandatory mandatory β€” and Embree internally uses the topmost instance transformation of the stack to transform the point query into instance space. Main character behavior honestly. πŸ‘‘


πŸ’€ EXIT STATUS πŸ’€

No error code is set by this function. Not a single one. Clean. ✨


🌈 SEE ALSO 🌈

  • [rtcPointQuery]
  • [rtcSetGeometryPointQueryFunction]

And that's the whole page, bestie β€” this was rtcInitPo...ryContext(3) from the Embree Ray Tracing Kernels 3 manual, section 3, and yeah the footer is literally just that same title again because the page said so. 🫢 Go forth and initialize your contexts. Periodt. πŸ’–πŸŒΈπŸŽ€

πŸ“¦ where this page comes from