MCPcopy Create free account
hub / github.com/RenderKit/embree / getTimeSegmentRange

Function getTimeSegmentRange

kernels/common/default.h:250–257  ·  view source on GitHub ↗

calculate overlapping time segment range */

Source from the content-addressed store, hash-verified

248
249 /* calculate overlapping time segment range */
250 __forceinline range<int> getTimeSegmentRange(const BBox1f& time_range, float numTimeSegments)
251 {
252 const float round_up = 1.0f+2.0f*float(ulp); // corrects inaccuracies to precisely match time step
253 const float round_down = 1.0f-2.0f*float(ulp);
254 const int itime_lower = (int)max(floor(round_up *time_range.lower*numTimeSegments), 0.0f);
255 const int itime_upper = (int)min(ceil (round_down*time_range.upper*numTimeSegments), numTimeSegments);
256 return make_range(itime_lower, itime_upper);
257 }
258
259 /* calculate overlapping time segment range */
260 __forceinline range<int> getTimeSegmentRange(const BBox1f& range, BBox1f time_range, float numTimeSegments)

Callers 4

timeSegmentRangeMethod · 0.85
timeSegmentRangeFunction · 0.85
operator()Method · 0.85
timeSegmentRangeFunction · 0.85

Calls 6

make_rangeFunction · 0.85
maxFunction · 0.50
floorFunction · 0.50
minFunction · 0.50
ceilFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected