Adding option to use second precision instead of milliosecond
This commit is contained in:
parent
3d235e0e14
commit
4e22172543
@ -119,6 +119,9 @@
|
|||||||
* - Adding extension to mousestate (Position) to get a Vector2 object of the position
|
* - 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
|
* - 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
|
#endregion
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ namespace GameStateManagement
|
|||||||
private float _agentTorque;
|
private float _agentTorque;
|
||||||
private FixedMouseJoint _fixedMouseJoint;
|
private FixedMouseJoint _fixedMouseJoint;
|
||||||
private Body _userAgent;
|
private Body _userAgent;
|
||||||
|
public bool UseSecondStep = false;
|
||||||
protected PhysicsGameScreen()
|
protected PhysicsGameScreen()
|
||||||
{
|
{
|
||||||
TransitionOnTime = TimeSpan.FromSeconds(0.75);
|
TransitionOnTime = TimeSpan.FromSeconds(0.75);
|
||||||
@ -101,7 +101,10 @@ namespace GameStateManagement
|
|||||||
if (!coveredByOtherScreen && !otherScreenHasFocus)
|
if (!coveredByOtherScreen && !otherScreenHasFocus)
|
||||||
{
|
{
|
||||||
// variable time step but never less then 30 Hz
|
// variable time step but never less then 30 Hz
|
||||||
|
if (UseSecondStep)
|
||||||
World.Step(Math.Min((float)gameTime.ElapsedGameTime.TotalSeconds, (1f / 30f)));
|
World.Step(Math.Min((float)gameTime.ElapsedGameTime.TotalSeconds, (1f / 30f)));
|
||||||
|
else
|
||||||
|
World.Step((float)(gameTime.ElapsedGameTime.TotalMilliseconds * 0.001));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user