Esempio n. 1
0
 public BlimpCameraMan(ILocatable posLoc, ILocatable lookAt)
 {
     Dirty    = true;
     Pos3d    = posLoc.ToPositionAboveSeaLeveld(_altitude);
     LookAt   = new Location(lookAt);
     LookAt3d = LookAt.ToPositionAboveSeaLeveld(0);
 }
Esempio n. 2
0
        public void Scale(ILocatable loc, float scale)
        {
            var toCam = (Pos3d - LookAt3d);
            var dist  = toCam.Length;

            var sdist = dist / scale;

            toCam.Normalize();
            var newPos = LookAt3d + toCam * sdist;

            var alt = newPos.Length - Location.EarthRadiusInKm;

            _altitude = (float)alt;
            if (_altitude > 12500.0f)
            {
                _altitude = 12500.0f;
            }
            if (_altitude < 0.03f)
            {
                _altitude = 0.03f;
            }

            Pos3d = _pos.ToPositionAboveSeaLeveld(_altitude);

            Dirty = true;
        }
Esempio n. 3
0
 public ManualCameraMan(ILocatable posLoc, ILocatable lookAt)
 {
     Dirty    = true;
     _pos     = new Location(posLoc);
     Pos3d    = _pos.ToPositionAboveSeaLeveld(_altitude);
     LookAt   = new Location(lookAt);
     LookAt3d = LookAt.ToPositionAboveSeaLeveld(0);
 }
Esempio n. 4
0
        public void Rotate(ILocatable loc, float ddegs)
        {
            _pos   = _pos.RotateAround(loc, ddegs);
            LookAt = LookAt.RotateAround(loc, ddegs);

            Pos3d    = _pos.ToPositionAboveSeaLeveld(_altitude);
            LookAt3d = LookAt.ToPositionAboveSeaLeveld(0);

            Dirty = true;
        }
Esempio n. 5
0
        public void Drag(Location start, Location end)
        {
            var d = -start.VectorTo(end);

            _pos     = _pos.LocationAway(d);
            Pos3d    = _pos.ToPositionAboveSeaLeveld(_altitude);
            LookAt   = LookAt.LocationAway(d);
            LookAt3d = LookAt.ToPositionAboveSeaLeveld(0);

            Dirty = true;
        }
Esempio n. 6
0
 public void SetLookAt(ILocatable lookAt, bool animated)
 {
     if (animated)
     {
         _lookAtAnim = new LocLinAnim(2, LookAt, lookAt);
         var oldLocPos = LookAt.ToPositionAboveSeaLeveld(_altitude);
         _posAnim = new VectorLinAnim(5, Pos3d, oldLocPos);
     }
     else
     {
         LookAt   = new Location(lookAt);
         LookAt3d = LookAt.ToPositionAboveSeaLeveld(0);
         Dirty    = true;
     }
 }
Esempio n. 7
0
 public BlimpCameraMan(ILocatable posLoc, ILocatable lookAt)
 {
     Dirty = true;
     Pos3d = posLoc.ToPositionAboveSeaLeveld (_altitude);
     LookAt = new Location (lookAt);
     LookAt3d = LookAt.ToPositionAboveSeaLeveld (0);
 }
Esempio n. 8
0
        public void Rotate(ILocatable loc, float ddegs)
        {
            _pos = _pos.RotateAround(loc, ddegs);
            LookAt = LookAt.RotateAround(loc, ddegs);

            Pos3d = _pos.ToPositionAboveSeaLeveld (_altitude);
            LookAt3d = LookAt.ToPositionAboveSeaLeveld (0);

            Dirty = true;
        }
Esempio n. 9
0
        public void Drag(Location start, Location end)
        {
            var d = -start.VectorTo(end);

            _pos = _pos.LocationAway(d);
            Pos3d = _pos.ToPositionAboveSeaLeveld (_altitude);
            LookAt = LookAt.LocationAway(d);
            LookAt3d = LookAt.ToPositionAboveSeaLeveld (0);

            Dirty = true;
        }
Esempio n. 10
0
 public ManualCameraMan(ILocatable posLoc, ILocatable lookAt)
 {
     Dirty = true;
     _pos = new Location(posLoc);
     Pos3d = _pos.ToPositionAboveSeaLeveld (_altitude);
     LookAt = new Location (lookAt);
     LookAt3d = LookAt.ToPositionAboveSeaLeveld (0);
 }
Esempio n. 11
0
 public void SetLookAt(ILocatable lookAt, bool animated)
 {
     if (animated) {
         _lookAtAnim = new LocLinAnim(2, LookAt, lookAt);
         var oldLocPos = LookAt.ToPositionAboveSeaLeveld(_altitude);
         _posAnim = new VectorLinAnim(5, Pos3d, oldLocPos);
     }
     else {
         LookAt = new Location(lookAt);
         LookAt3d = LookAt.ToPositionAboveSeaLeveld (0);
         Dirty = true;
     }
 }