Skip to content

FixedPhysics now uses Double instead of Float for increased precision.#140

Merged
SoloByte merged 3 commits intomainfrom
fixed-physics-double-precision
Jan 16, 2026
Merged

FixedPhysics now uses Double instead of Float for increased precision.#140
SoloByte merged 3 commits intomainfrom
fixed-physics-double-precision

Conversation

@SoloByte
Copy link
Collaborator

No description provided.

…sed precision.

Fix: AdvanceFixedUpdate now uses FixedPhysicsTimestep to tick FixedTime instead of incorrectly using FixedPhysicsFramerate.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR converts the fixed physics update system from single-precision (float) to double-precision (double) for improved accuracy in physics calculations. The changes affect timing calculations throughout the fixed update loop, including the physics accumulator, frame time calculations, and timestep management.

Changes:

  • Added a new DeltaDouble property to GameTime for accessing elapsed time with double precision
  • Changed FixedPhysicsTimestep from float to double for more precise timestep calculations
  • Updated AdvanceFixedUpdate method to use double throughout physics accumulation and timing logic
  • Modified FixedTime to use Tick(double) instead of TickF(float) for consistent double precision

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
ShapeEngine/Core/Structs/GameTime.cs Adds DeltaDouble property to provide direct access to the underlying ElapsedSeconds value without float conversion
ShapeEngine/Core/GameDef/GameGameloop.cs Updates AdvanceFixedUpdate to accept and use double for all timing calculations and changes call from TickF to Tick
ShapeEngine/Core/GameDef/Game.cs Changes FixedPhysicsTimestep property and physicsAccumulator field from float to double

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SoloByte SoloByte merged commit 80a22b2 into main Jan 16, 2026
7 checks passed
@SoloByte SoloByte deleted the fixed-physics-double-precision branch January 16, 2026 10:15
@github-project-automation github-project-automation bot moved this from Review to Done in Shape Engine Roadmap Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Development

Successfully merging this pull request may close these issues.

Change fixed physics system to double instead of float for increased precision

2 participants