Commits

Cliff Biffle  committed bd8b773

Pinch-zoom gestures now change the FOV (i.e. zoom) instead of changing camera.z (dollying).

  • Participants
  • Parent commits 8608896
  • Branches shaders

Comments (0)

Files changed (1)

File KVDepthView.m

 
 - (void) magnifyWithEvent: (NSEvent *)theEvent {
   float mag = (float) [theEvent magnification];
-  camera.pos.z += mag;
-  camera.target.z += mag;
+  camera.fov -= mag * 10.f;
+  if (camera.fov < 5.f) camera.fov = 5.f;
   [self updateProjection];
   [self setNeedsDisplay: YES];
 }