Exemplo n.º 1
0
        private void ReloadSteeringScenario()
        {
            m_blnIsLoading = true;

            mHighResTimer.Stop();
            mFormsTimer.Stop();

            mBuffer1 = mGraphContext.Allocate(pnlViewPort.CreateGraphics(), pnlViewPort.DisplayRectangle);

            mBuffer1.Graphics.Clear(Color.White);

            m_objSteeringScenario = new SteeringScenario(pnlViewPort.Width, pnlViewPort.Height);

            m_objSteeringScenario.UseWalls             = chkWalls.Checked;
            m_objSteeringScenario.UseObstacles         = chkObstacles.Checked;
            m_objSteeringScenario.UseRenderAids        = chkRenderAides.Checked;
            m_objSteeringScenario.UseSpacePartitioning = chkSpacePart.Checked;

            spinMaxForce.Value   = (decimal)m_objSteeringScenario.SharkMaxForce;
            spinMaxSpeed.Value   = (decimal)m_objSteeringScenario.SharkMaxSpeed;
            spinAlignment.Value  = (decimal)m_objSteeringScenario.AlignmentWeight;
            spinCohesion.Value   = (decimal)m_objSteeringScenario.CohesionWeight;
            spinSeparation.Value = (decimal)m_objSteeringScenario.SeparationWeight;

            if (cmboSamples.SelectedItem.ToString() == "None")
            {
                m_objSteeringScenario.UseSmoothing = false;
            }
            else
            {
                m_objSteeringScenario.UseSmoothing     = true;
                m_objSteeringScenario.SmoothingSamples = int.Parse(cmboSamples.SelectedItem.ToString());
            }

            RefreshGUIChaseMode();

            ReDraw();

            mFormsTimer.Start();
            mHighResTimer.Start();

            m_blnIsLoading = false;
        }
Exemplo n.º 2
0
        private void ReloadSteeringScenario()
        {
            m_blnIsLoading = true;

            mHighResTimer.Stop();
            mFormsTimer.Stop();   

            mBuffer1 = mGraphContext.Allocate(pnlViewPort.CreateGraphics(), pnlViewPort.DisplayRectangle);

            mBuffer1.Graphics.Clear(Color.White);

            m_objSteeringScenario = new SteeringScenario(pnlViewPort.Width, pnlViewPort.Height);           
                        
            m_objSteeringScenario.UseWalls = chkWalls.Checked;
            m_objSteeringScenario.UseObstacles = chkObstacles.Checked;
            m_objSteeringScenario.UseRenderAids = chkRenderAides.Checked;
            m_objSteeringScenario.UseSpacePartitioning = chkSpacePart.Checked;

            spinMaxForce.Value = (decimal)m_objSteeringScenario.SharkMaxForce;
            spinMaxSpeed.Value = (decimal)m_objSteeringScenario.SharkMaxSpeed;
            spinAlignment.Value = (decimal)m_objSteeringScenario.AlignmentWeight;
            spinCohesion.Value = (decimal)m_objSteeringScenario.CohesionWeight;
            spinSeparation.Value = (decimal)m_objSteeringScenario.SeparationWeight;

            if (cmboSamples.SelectedItem.ToString() == "None")
            {
                m_objSteeringScenario.UseSmoothing = false;
            }
            else
            {
                m_objSteeringScenario.UseSmoothing = true;
                m_objSteeringScenario.SmoothingSamples = int.Parse(cmboSamples.SelectedItem.ToString());
            }

            RefreshGUIChaseMode();

            ReDraw();

            mFormsTimer.Start();
            mHighResTimer.Start();

            m_blnIsLoading = false;
        }