Beispiel #1
0
        /// <summary>
        /// Updates the object and its contained resources.
        /// </summary>
        /// <param name="gameTime"/>
        public void Update(GameTime gameTime)
        {
            for (int i = 0; i < _bepuCollisionMoves.Count; i++)
            {
                _bepuCollisionMoves[i].Begin();
            }

            if (_sceneInterface.GetManager <SunBurnEditor>(false) != null && _sceneInterface.GetManager <SunBurnEditor>(true).EditorAttached)
            {
                return;
            }

            if (UseInternalTimeStepping)
            {
                Space.Update((float)gameTime.ElapsedGameTime.TotalSeconds);
            }
            else
            {
                Space.Update();
            }


            for (int i = 0; i < _bepuCollisionMoves.Count; i++)
            {
                _bepuCollisionMoves[i].End();
            }
        }
Beispiel #2
0
        public void EndFrameRendering()
        {
            var bepuPhysicsManager = _sceneInterface.GetManager <BEPUPhysicsManager>(false);

            if (bepuPhysicsManager == null)
            {
                return;
            }

            if (!Visible || _sceneState == null)
            {
                return;
            }

            ModelDrawer.Draw(_sceneState.View, _sceneState.Projection);

            LineDrawer.LightingEnabled    = false;
            LineDrawer.VertexColorEnabled = true;
            LineDrawer.World      = Matrix.Identity;
            LineDrawer.View       = _sceneState.View;
            LineDrawer.Projection = _sceneState.Projection;

            ContactDrawer.Draw(LineDrawer, bepuPhysicsManager.Space);

            BoundingBoxDrawer.Draw(LineDrawer, bepuPhysicsManager.Space);

            SimulationIslandDrawer.Draw(LineDrawer, bepuPhysicsManager.Space);

            Application.Graphics.GraphicsDevice.SamplerStates.Reset();
        }