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

Function animateSphere

tutorials/dynamic_scene/dynamic_scene_device.cpp:150–167  ·  view source on GitHub ↗

animates the sphere */

Source from the content-addressed store, hash-verified

148
149/* animates the sphere */
150void animateSphere (int taskIndex, int threadIndex, Vertex* vertices,
151 const float rcpNumTheta,
152 const float rcpNumPhi,
153 const Vec3fa& pos,
154 const float r,
155 const float f)
156{
157 int phi = taskIndex;
158 for (int theta=0; theta<data.numTheta; theta++)
159 {
160 Vertex* v = &vertices[phi*data.numTheta+theta];
161 const float phif = phi*float(pi)*rcpNumPhi;
162 const float thetaf = theta*2.0f*float(pi)*rcpNumTheta;
163 v->x = pos.x + r*sin(f*phif)*sin(thetaf);
164 v->y = pos.y + r*cos(phif);
165 v->z = pos.z + r*sin(f*phif)*cos(thetaf);
166 }
167}
168
169/* task that renders a single screen tile */
170void renderPixelStandard(const TutorialData& data,

Callers 1

device_renderFunction · 0.70

Calls 10

rtcGetGeometryBufferDataFunction · 0.85
parallel_forFunction · 0.85
rtcUpdateGeometryBufferFunction · 0.85
rtcCommitGeometryFunction · 0.85
sinFunction · 0.50
cosFunction · 0.50
rcpFunction · 0.50
Vec3faClass · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected