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

Method rotateOrbit

tutorials/common/tutorial/camera.h:104–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102 }
103
104 void rotateOrbit (float dtheta, float dphi)
105 {
106 if (handedness == RIGHT_HANDED) dtheta *= -1.0f;
107 const Vec3fa up1 = normalize(up);
108 Vec3fa view1 = normalize(to-from);
109 view1 = xfmVector(AffineSpace3fa::rotate(up1, dtheta), view1);
110 const float phi = acosf(dot(view1, up1));
111 const float dphi2 = phi - clamp(phi-dphi, 0.001f*float(pi), 0.999f*float(pi));
112 view1 = xfmVector(AffineSpace3fa::rotate(cross(view1, up1), dphi2), view1);
113 from = to - length(to-from) * view1;
114 }
115
116 void dolly (float ds)
117 {

Callers 1

motionFuncMethod · 0.80

Calls 7

rotateFunction · 0.85
normalizeFunction · 0.50
xfmVectorFunction · 0.50
dotFunction · 0.50
clampFunction · 0.50
crossFunction · 0.50
lengthFunction · 0.50

Tested by

no test coverage detected