clampSpeed :: Float -> Camera -> Camera
clampSpeed maxSpeed = velocity %~ aux
  where aux v = let q = quadrance v
                in if q >= maxSpeed*maxSpeed 
                   then maxSpeed *^ fmap (/ sqrt q) v
                   else v
clampSpeed :: Float -> Camera -> Camera
clampSpeed maxSpeed = velocity %~ aux
  where aux v = let q = quadrance v
                in if q >= maxSpeed*maxSpeed 
                   then maxSpeed *^ fmap (/ sqrt q) v
                   else v
clampSpeed maxSpeed = velocity %~ aux
  where aux v = let q = quadrance v
                in if q >= maxSpeed*maxSpeed 
                   then maxSpeed *^ fmap (/ sqrt q) v
                   else v