rtcGetSceneBounds(3)

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

πŸ’– rtcGetSceneBounds β€” ok bestie, let's get those scene bounds πŸ’–

So this is a page from the Embree Ray Tracing Kernels 3 manual, and it's all about rtcGetSceneBounds(3). Sit with me, we're gonna read it together, it's short and it's giving very demure, very mindful. πŸŽ€


✨ NAME ✨

rtcGetSceneBounds β€” returns the axis-aligned bounding box of the scene. That's it, that's the whole job. She's a one-trick pony and honestly? The trick is iconic. πŸ‘‘


🌸 SYNOPSIS 🌸

First you gotta bring her in, so:

#include <embree3/rtcore.h>

Then the struct, and pay attention bestie, because the alignment attribute is right there in the declaration:

struct RTCORE_ALIGN(16) RTCBounds
{
  float lower_x, lower_y, lower_z, align0;
  float upper_x, upper_y, upper_z, align1;
};

And the function itself:

void rtcGetSceneBounds(
  RTCScene scene,
  struct RTCBounds* bounds_o
);

That's the whole vibe. Two args. No cap. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's what's actually happening. The rtcGetSceneBounds function queries the axis-aligned bounding box of the specified scene β€” that's your scene argument, the star of the show β€” and it stores that bounding box into the destination pointer you handed it, aka the bounds_o argument. 🫢

The bounding box it stores? It's made up of lower and upper bounds for the x, y, and z dimensions, exactly as laid out by the RTCBounds structure. So like, one struct, six floats of real data, plus the padding besties.

Now here's the part where I need you to lock in:

The destination pointer you provide must be aligned to 16 bytes. Not vibes-aligned. Actually 16-byte aligned. If it isn't, that's on you. 😭

And also:

You may only invoke this function after committing the scene. If you call it before committing, the result is undefined β€” like, genuinely undefined, not the fun kind. Commit first, then ask for bounds. In that order. Periodt. πŸ”₯

πŸ’€ EXIT STATUS πŸ’€

If something goes wrong, an error code gets set, and you can go query it with rtcGetDeviceError. That's your little check-in bestie, always ask. πŸ™ˆ


🌈 SEE ALSO 🌈

Go read these next, they're all connected, iykyk:

  • rtcGetSceneLinearBounds
  • rtcCommitScene
  • rtcJoinCommitScene

ok that's the whole page, you ate it, you understood it, I'm so proud of you πŸ’–βœ¨ This was rtcGetSceneBounds(3) from the Embree Ray Tracing Kernels 3 manual, and this little sign-off is coming to you straight from that same source and version. Go forth and bound your scenes, bestie. πŸŽ€πŸ¦‹πŸ‘‘

πŸ“¦ where this page comes from