Example #1
0
        public void Pan(float x, float y)
        {
            var position = _position + _rotation.Up() * y + _rotation.Right() * x;
            var pivot    = _pivot + _rotation.Up() * y + _rotation.Right() * x;

            MoveCamera(position, _rotation, pivot);
        }
Example #2
0
 private void MoveCamera(Vector3 position, Quaternion rotation, Vector3 pivot, bool animate = false)
 {
     if (!animate)
     {
         _position = position;
         _rotation = rotation;
         _pivot    = pivot;
         _rendererCamera.Move(position, _rotation.Forward(), _rotation.Up());
         if (_cameraLight != null)
         {
             _cameraLight.Position = position;
         }
     }
     else
     {
         _coroutines.StartCoroutine(AnimateCamera(position, rotation, pivot));
     }
 }