Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Version History
- Updated TinyEXR dependency to fix resource leaks.
- Reduced memory copies and improved move semantics usage.
- Bumped CMake minimum required version to 3.10.
- Updated `RTCBoundsFunctionArguments` struct to include `boundsUserPtr` field for consistency across all APIs and documentation.

### Embree 4.4.0

Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5812,6 +5812,7 @@ On failure an error code is set that can be queried using
unsigned int primID;
unsigned int timeStep;
struct RTCBounds* bounds_o;
void* boundsUserPtr;
};

typedef void (*RTCBoundsFunction)(
Expand Down Expand Up @@ -5846,8 +5847,9 @@ pointer to a structure of type `RTCBoundsFunctionArguments` which
contains various arguments, such as: the user data of the geometry
(`geometryUserPtr` member), the ID of the primitive to calculate the
bounds for (`primID` member), the time step at which to calculate the
bounds (`timeStep` member), and a memory location to write the
calculated bound to (`bounds_o` member).
bounds (`timeStep` member), a memory location to write the
calculated bound to (`bounds_o` member), and the custom pointer data
provided to `rtcSetGeometryBoundsFunction` (`boundsUserPtr` member).

In a typical usage scenario one would store a pointer to the internal
representation of the user geometry object using
Expand Down
6 changes: 4 additions & 2 deletions doc/src/api/rtcSetGeometryBoundsFunction.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
unsigned int primID;
unsigned int timeStep;
struct RTCBounds* bounds_o;
void* boundsUserPtr;
};

typedef void (*RTCBoundsFunction)(
Expand Down Expand Up @@ -49,8 +50,9 @@ pointer to a structure of type `RTCBoundsFunctionArguments` which
contains various arguments, such as: the user data of the geometry
(`geometryUserPtr` member), the ID of the primitive to calculate the
bounds for (`primID` member), the time step at which to calculate the
bounds (`timeStep` member), and a memory location to write the
calculated bound to (`bounds_o` member).
bounds (`timeStep` member), a memory location to write the
calculated bound to (`bounds_o` member), and the custom pointer data
provided to `rtcSetGeometryBoundsFunction` (`boundsUserPtr` member).

In a typical usage scenario one would store a pointer to the internal
representation of the user geometry object using
Expand Down
1 change: 1 addition & 0 deletions include/embree4/rtcore_geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ struct RTCBoundsFunctionArguments
unsigned int primID;
unsigned int timeStep;
struct RTCBounds* bounds_o;
void* boundsUserPtr;
};

/* Bounding callback function */
Expand Down
1 change: 1 addition & 0 deletions include/embree4/rtcore_geometry.isph
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ struct RTCBoundsFunctionArguments
uniform unsigned int primID;
uniform unsigned int timeStep;
uniform RTCBounds* uniform bounds_o;
void* uniform boundsUserPtr;
};

/* Bounding callback function */
Expand Down
2 changes: 1 addition & 1 deletion kernels/common/accelset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace embree
{
AccelSet::AccelSet (Device* device, Geometry::GType gtype, size_t numItems, size_t numTimeSteps)
: Geometry(device,gtype,(unsigned int)numItems,(unsigned int)numTimeSteps), boundsFunc(nullptr) {}
: Geometry(device,gtype,(unsigned int)numItems,(unsigned int)numTimeSteps), boundsFunc(nullptr), boundsUserPtr(nullptr) {}

AccelSet::IntersectorN::IntersectorN (ErrorFunc error)
: intersect((IntersectFuncN)error), occluded((OccludedFuncN)error), name(nullptr) {}
Expand Down
3 changes: 3 additions & 0 deletions kernels/common/accelset.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ namespace embree
assert(i < size());
RTCBoundsFunctionArguments args;
args.geometryUserPtr = userPtr;
args.boundsUserPtr = boundsUserPtr;
args.primID = (unsigned int)i;
args.timeStep = (unsigned int)itime;
args.bounds_o = (RTCBounds*)&box;
Expand All @@ -91,6 +92,7 @@ namespace embree
assert(i < size());
RTCBoundsFunctionArguments args;
args.geometryUserPtr = userPtr;
args.boundsUserPtr = boundsUserPtr;
args.primID = (unsigned int)i;
args.timeStep = (unsigned int)(itime+0);
args.bounds_o = (RTCBounds*)&box[0];
Expand Down Expand Up @@ -335,6 +337,7 @@ namespace embree

public:
RTCBoundsFunction boundsFunc;
void* boundsUserPtr;
IntersectorN intersectorN;
};

Expand Down
1 change: 1 addition & 0 deletions kernels/common/scene_user_geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace embree

void UserGeometry::setBoundsFunction (RTCBoundsFunction bounds, void* userPtr) {
this->boundsFunc = bounds;
this->boundsUserPtr = userPtr;
}

void UserGeometry::setIntersectFunctionN (RTCIntersectFunctionN intersect) {
Expand Down
6 changes: 4 additions & 2 deletions man/man3/rtcSetGeometryBoundsFunction.3embree4
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct RTCBoundsFunctionArguments
unsigned int primID;
unsigned int timeStep;
struct RTCBounds* bounds_o;
void* boundsUserPtr;
};

typedef void (*RTCBoundsFunction)(
Expand Down Expand Up @@ -53,8 +54,9 @@ invoked with a pointer to a structure of type
such as: the user data of the geometry (\f[CR]geometryUserPtr\f[R]
member), the ID of the primitive to calculate the bounds for
(\f[CR]primID\f[R] member), the time step at which to calculate the
bounds (\f[CR]timeStep\f[R] member), and a memory location to write the
calculated bound to (\f[CR]bounds_o\f[R] member).
bounds (\f[CR]timeStep\f[R] member), a memory location to write the
calculated bound to (\f[CR]bounds_o\f[R] member), and the custom pointer
data provided to \f[CR]rtcSetGeometryBoundsFunction\f[R] (\f[CR]boundsUserPtr\f[R] member).
.PP
In a typical usage scenario one would store a pointer to the internal
representation of the user geometry object using
Expand Down
Loading