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

Method rotate

tutorials/common/tutorial/camera.h:92–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90 }
91
92 void rotate (float dtheta, float dphi)
93 {
94 if (handedness == RIGHT_HANDED) dtheta *= -1.0f;
95 const Vec3fa up1 = normalize(up);
96 Vec3fa view1 = normalize(to-from);
97 view1 = xfmVector(AffineSpace3fa::rotate(up1, dtheta), view1);
98 const float phi = acosf(dot(view1, up1));
99 const float dphi2 = phi - clamp(phi-dphi, 0.001f*float(pi), 0.999f*float(pi));
100 view1 = xfmVector(AffineSpace3fa::rotate(cross(view1, up1), dphi2), view1);
101 to = from + length(to-from) * view1;
102 }
103
104 void rotateOrbit (float dtheta, float dphi)
105 {

Callers 2

keyboardFuncMethod · 0.45
motionFuncMethod · 0.45

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