From 4e2217254397c1c97f06fc257ef43facd0d742d0 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Sun, 27 Jan 2013 22:26:00 -0600 Subject: [PATCH] Adding option to use second precision instead of milliosecond --- axios/Axios_settings.cs | 3 +++ axios/ScreenSystem/PhysicsGameScreen.cs | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/axios/Axios_settings.cs b/axios/Axios_settings.cs index 689289e..96aaec6 100644 --- a/axios/Axios_settings.cs +++ b/axios/Axios_settings.cs @@ -119,6 +119,9 @@ * - Adding extension to mousestate (Position) to get a Vector2 object of the position * - Added MouseAimVector to AGS - this allows you to get a vector to "shoot" with (realtive to the mouse and another object) a LinearVelocity in Farseer * + * 1.0.1.8 - 1/12/2012 + * - Adding UseSecondStep flag in PhysicsGameScreen (default false) + * */ #endregion diff --git a/axios/ScreenSystem/PhysicsGameScreen.cs b/axios/ScreenSystem/PhysicsGameScreen.cs index 3b19057..53cbed2 100644 --- a/axios/ScreenSystem/PhysicsGameScreen.cs +++ b/axios/ScreenSystem/PhysicsGameScreen.cs @@ -21,7 +21,7 @@ namespace GameStateManagement private float _agentTorque; private FixedMouseJoint _fixedMouseJoint; private Body _userAgent; - + public bool UseSecondStep = false; protected PhysicsGameScreen() { TransitionOnTime = TimeSpan.FromSeconds(0.75); @@ -101,7 +101,10 @@ namespace GameStateManagement if (!coveredByOtherScreen && !otherScreenHasFocus) { // variable time step but never less then 30 Hz - World.Step(Math.Min((float)gameTime.ElapsedGameTime.TotalSeconds, (1f / 30f))); + if (UseSecondStep) + World.Step(Math.Min((float)gameTime.ElapsedGameTime.TotalSeconds, (1f / 30f))); + else + World.Step((float)(gameTime.ElapsedGameTime.TotalMilliseconds * 0.001)); } else {