Example #1
0
 public void Update(SimTime t)
 {
     if (_lookAtAnim != null)
     {
         if (_lookAtAnim.Update(t))
         {
             LookAt   = _lookAtAnim.Value;
             LookAt3d = LookAt.ToPositionAboveSeaLeveld(0);
             Dirty    = true;
         }
         else
         {
             _lookAtAnim = null;
         }
     }
     if (_posAnim != null)
     {
         if (_posAnim.Update(t))
         {
             Pos3d = _posAnim.Value;
             Dirty = true;
         }
         else
         {
             _posAnim = null;
         }
     }
 }
Example #2
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;
        }
Example #3
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;
        }
Example #4
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;
     }
 }