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

Function calculate_interpolated_space

tutorials/pathtracer/pathtracer_device.cpp:1343–1354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1341}
1342
1343AffineSpace3fa calculate_interpolated_space (ISPCInstance* instance, float gtime)
1344{
1345 if (instance->numTimeSteps == 1)
1346 return AffineSpace3fa(instance->spaces[0]);
1347
1348 /* calculate time segment itime and fractional time ftime */
1349 const int time_segments = instance->numTimeSteps-1;
1350 const float time = gtime*(float)(time_segments);
1351 const int itime = clamp((int)(floor(time)),(int)0,time_segments-1);
1352 const float ftime = time - (float)(itime);
1353 return (1.0f-ftime)*AffineSpace3fa(instance->spaces[itime+0]) + ftime*AffineSpace3fa(instance->spaces[itime+1]);
1354}
1355
1356typedef ISPCInstance* ISPCInstancePtr;
1357

Callers 1

postIntersectFunction · 0.70

Calls 2

clampFunction · 0.50
floorFunction · 0.50

Tested by

no test coverage detected