Skip to content

Fix physics being run with zero delta time#622

Merged
Jondolf merged 1 commit into
mainfrom
fix-paused-crash
Jan 11, 2025
Merged

Fix physics being run with zero delta time#622
Jondolf merged 1 commit into
mainfrom
fix-paused-crash

Conversation

@Jondolf

@Jondolf Jondolf commented Jan 10, 2025

Copy link
Copy Markdown
Member

Objective

Fixes #619.

When pausing physics, the PhysicsSchedule can still run even though the delta time is zero. This can cause simulation problems and sometimes even results in values becoming NaN or infinite due to division by zero.

This is a regression from 0.1, which handled scheduling differently and did not run physics with a delta time of zero.

Solution

Don't run the PhysicsSchedule if the delta time is zero.

@Jondolf Jondolf added C-Bug Something isn't working A-Scheduling Relates to scheduling or system sets P-Regression Behaviour that was working before is now worse or broken.Add a test for this! and removed C-Bug Something isn't working labels Jan 10, 2025
@Jondolf Jondolf merged commit a6fc5bf into main Jan 11, 2025
@Jondolf Jondolf deleted the fix-paused-crash branch January 11, 2025 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Scheduling Relates to scheduling or system sets P-Regression Behaviour that was working before is now worse or broken.Add a test for this!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Panic when pausing physics time

1 participant