Esempio n. 1
0
        public void blend(DiscStateProperties target, float percent)
        {
            Disc disc = DiscController.getDisc(discName);

            if (disc != null)
            {
                disc.DiscOffset       = this.discOffset.lerp(ref target.discOffset, ref percent);
                disc.RDAOffset        = this.rdaOffset.lerp(ref target.rdaOffset, ref percent);
                disc.HorizontalOffset = this.horizontalOffset.lerp(ref target.horizontalOffset, ref percent);
                disc.ClockFaceOffset  = this.clockFaceOffset.lerp(ref target.clockFaceOffset, ref percent);
                float delta = target.popLocation - this.popLocation;
                disc.PopLocation = this.popLocation + delta * percent;
                if (percent < 0.05f)
                {
                    disc.DisplaceLateralPole = displaceLateralPole;
                }
                else
                {
                    disc.DisplaceLateralPole = target.displaceLateralPole;
                }
                if (percent < 1.0f)
                {
                    disc.Locked = locked;
                }
                else
                {
                    disc.Locked = target.locked;
                }
            }
        }
Esempio n. 2
0
 public void addPosition(DiscStateProperties prop)
 {
     if (discs.ContainsKey(prop.DiscName))
     {
         discs[prop.DiscName] = prop;
     }
     else
     {
         discs.Add(prop.DiscName, prop);
     }
 }
Esempio n. 3
0
 public void captureFromState(DiscStateProperties state)
 {
     if (state != null)
     {
         this.DiscOffset          = state.DiscOffset;
         this.HorizontalOffset    = state.HorizontalOffset;
         this.Locked              = state.Locked;
         this.PopLocation         = state.PopLocation;
         this.RdaOffset           = state.RDAOffset;
         this.DisplaceLateralPole = state.DisplaceLateralPole;
         this.ClockFaceOffset     = state.ClockFaceOffset;
     }
 }
Esempio n. 4
0
 public override void applyToState(MedicalState state)
 {
     if (state != null)
     {
         DiscStateProperties disc = new DiscStateProperties(discName);
         disc.DiscOffset          = discOffset;
         disc.HorizontalOffset    = horizontalOffset;
         disc.Locked              = locked;
         disc.PopLocation         = popLocation;
         disc.RDAOffset           = rdaOffset;
         disc.DisplaceLateralPole = displaceLateralPole;
         disc.ClockFaceOffset     = clockFaceOffset;
         state.Disc.addPosition(disc);
     }
 }