public MainWindow()
        {
            InitializeComponent();

            frameTimer          = new System.Windows.Threading.DispatcherTimer();
            frameTimer.Tick    += OnFrame;
            frameTimer.Interval = TimeSpan.FromSeconds(1.0 / 60.0);
            frameTimer.Start();

            this.spawnPoint = new Point3D(0.0, 0.0, 0.0);
            this.lastTick   = Environment.TickCount;

            pm = new ParticleSystemManager();

            this.WorldModels.Children.Add(pm.CreateParticleSystem(1000, Colors.Gray));
            this.WorldModels.Children.Add(pm.CreateParticleSystem(1000, Colors.Red));
            this.WorldModels.Children.Add(pm.CreateParticleSystem(1000, Colors.Silver));
            this.WorldModels.Children.Add(pm.CreateParticleSystem(1000, Colors.Orange));
            this.WorldModels.Children.Add(pm.CreateParticleSystem(1000, Colors.Yellow));

            rand = new Random(this.GetHashCode());

            this.KeyDown += new System.Windows.Input.KeyEventHandler(Window1_KeyDown);
            this.Cursor   = System.Windows.Input.Cursors.None;
        }
Exemple #2
0
        public Window1()
        {
            InitializeComponent();

            frameTimer = new System.Windows.Threading.DispatcherTimer();
            frameTimer.Tick += OnFrame;
            frameTimer.Interval = TimeSpan.FromSeconds(1.0 / 60.0);
            frameTimer.Start();

            spawnPoint = new Point3D(0.0, 0.0, 0.0);
            lastTick = Environment.TickCount;

            pm = new ParticleSystemManager();

            var systems = pm.CreateParticleSystems(1000, Colors.Gray, Colors.Red, Colors.Silver, Colors.Orange, Colors.Yellow);
            systems.ForEach(x => WorldModels.Children.Add(x));

            rand = new Random(this.GetHashCode());

            KeyDown += Window1_KeyDown;
            Cursor = System.Windows.Input.Cursors.None;
        }
        /// <summary>
        /// initializes the various particle systems
        /// </summary>
        private void initParticleSystem()
        {
            //this.spawnPoints = new Dictionary<Color,Point3D>();
            this.lastTick = Environment.TickCount;

            pm = new ParticleSystemManager();

            this.WorldModels.Children.Add(pm.CreateParticleSystem(maxParticleCountPerSystem, this.colorBodyCenter));

            this.WorldModels.Children.Add(pm.CreateParticleSystem(maxParticleCountPerSystem, this.colorLeftHand));
            this.WorldModels.Children.Add(pm.CreateParticleSystem(maxParticleCountPerSystem, this.colorRightHand));
            this.WorldModels.Children.Add(pm.CreateParticleSystem(maxParticleCountPerSystem, this.colorMousePoint));
            this.WorldModels.Children.Add(pm.CreateParticleSystem(maxParticleCountPerSystem, this.colorHandCenterPoint));

            random = new Random();

            for(int i = 0; i < this.handCenterThicknesses.Length; i++){
                this.playerCenterPoints[i] = new List<Point3D>();
                this.rightHandPoints[i] = new List<Point3D>();
                this.leftHandPoints[i] = new List<Point3D>();
                this.handCenterPoints[i] = new List<Point3D>();
                this.handCenterThicknesses[i] = 10.0;
            }
        }
 public ParticleSpawningCoordinator(ParticleSystemManager particleSystemManager, Random randomNumberGenerator)
 {
     _particleSystemManager = particleSystemManager;
     _randomNumberGenerator = randomNumberGenerator;
 }
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            _worldModels = GetTemplateChild("PART_WorldModels") as Model3DGroup;
            _camera = GetTemplateChild("PART_Camera") as OrthographicCamera;
            _world = GetTemplateChild("PART_World") as Viewport3D;

            _frameTimer = new System.Windows.Threading.DispatcherTimer();
            _frameTimer.Tick += OnFrame;
            _frameTimer.Interval = TimeSpan.FromSeconds(1.0 / 45.0);
            _frameTimer.Start();

            this._lastTick = Environment.TickCount;

            _pm = new ParticleSystemManager();

            this._worldModels.Children.Add(_pm.CreateParticleSystem(1000, Colors.Gray, ImageSource));
            this._worldModels.Children.Add(_pm.CreateParticleSystem(1000, Colors.Red, ImageSource));
            this._worldModels.Children.Add(_pm.CreateParticleSystem(1000, Colors.Silver, ImageSource));
            this._worldModels.Children.Add(_pm.CreateParticleSystem(1000, Colors.OldLace, ImageSource));
            this._worldModels.Children.Add(_pm.CreateParticleSystem(1000, Colors.YellowGreen, ImageSource));
            this._worldModels.Children.Add(_pm.CreateParticleSystem(1000, Colors.Orange, ImageSource));

            _rand = new Random(this.GetHashCode());
        }
        public Window1()
        {
            InitializeComponent();

            frameTimer = new System.Windows.Threading.DispatcherTimer();
            frameTimer.Tick += OnFrame;
            frameTimer.Interval = TimeSpan.FromSeconds(1.0 / 60.0);
            frameTimer.Start();

            this.spawnPoint = new Point3D(0.0, 0.0, 0.0);
            this.lastTick = Environment.TickCount;

            pm = new ParticleSystemManager();

            this.WorldModels.Children.Add(pm.CreateParticleSystem(1000, Colors.Gray));
            this.WorldModels.Children.Add(pm.CreateParticleSystem(1000, Colors.Red));
            this.WorldModels.Children.Add(pm.CreateParticleSystem(1000, Colors.Silver));
            this.WorldModels.Children.Add(pm.CreateParticleSystem(1000, Colors.Orange));
            this.WorldModels.Children.Add(pm.CreateParticleSystem(1000, Colors.Yellow));

            rand = new Random(this.GetHashCode());

            this.KeyDown += new System.Windows.Input.KeyEventHandler(Window1_KeyDown);
            this.Cursor = System.Windows.Input.Cursors.None;
        }