public override void Update(GameTime gameTime)
        {
            ItemTime += gameTime.ElapsedGameTime.Milliseconds;
            if (ItemTime > MaxItemTime.get())
            {
                ItemTime -= MaxItemTime.get();

                CurrentItem++;
                if (CurrentItem > ModelCount.get() - 1)
                {
                    CurrentItem = 0;
                }
            }
            if (Items[CurrentItem] == null)
            {
                Items[CurrentItem] = new LineModelItem(Models[CurrentItem].get(), LineFlares.get(), RandomFlares.get());
            }
            Items[CurrentItem].Update(gameTime);

            WorldCameraInterpolation += gameTime.ElapsedGameTime.Milliseconds * 60 / 100000f * CameraSpeed.get();

            if (WorldCameraInterpolation > 1)
            {
                WorldCameraInterpolation = 0;
                WorldCameraFrom          = Rand.V3() * Items[CurrentItem].Distance * 3;
                WorldCameraTo            = Rand.V3() * Items[CurrentItem].Distance * 3;
                WorldCameraLookAt        = Items[CurrentItem].Points[Rand.r.Next(Items[CurrentItem].Points.Count)] / 2;
            }

            MyCamera.SetLookAt(Vector3.Lerp(WorldCameraFrom, WorldCameraTo, WorldCameraInterpolation), WorldCameraLookAt);

            base.Update(gameTime);
        }
 public LineModelRandomFlare(LineModelItem Parent, float ScaleSize)
 {
     this.Parent    = Parent;
     this.ScaleSize = ScaleSize;
     To             = Rand.V3() * ScaleSize / 25f;
 }
Exemple #3
0
 public LineModelFlare(LineModelItem Parent, int CurrentPosition, float ScaleSize)
 {
     this.Parent          = Parent;
     this.CurrentPosition = CurrentPosition;
     this.ScaleSize       = ScaleSize;
 }