Skip to content

Allow adding/removing Sleeping to sleep/wake bodies#834

Merged
Jondolf merged 2 commits into
mainfrom
fix-sleeping-component
Sep 30, 2025
Merged

Allow adding/removing Sleeping to sleep/wake bodies#834
Jondolf merged 2 commits into
mainfrom
fix-sleeping-component

Conversation

@Jondolf

@Jondolf Jondolf commented Sep 30, 2025

Copy link
Copy Markdown
Member

Objective

In past versions of Avian, adding/removing Sleeping manually was supported as a way to sleep or wake up a rigid body. However, after #809, this does not work properly, and you should instead use the SleepBody and WakeBody commands.

Additionally, SleepBody does not currently split the island, which can cause bodies that are not in contact to also be forced asleep.

Solution

Split islands when using SleepBody, and add hooks to automatically sleep/wake bodies when Sleeping is manually added/removed.

@Jondolf Jondolf added this to the 0.4 milestone Sep 30, 2025
@Jondolf Jondolf added C-Bug Something isn't working A-Dynamics Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on C-Usability A quality-of-life improvement that makes Avian easier to use labels Sep 30, 2025
@Jondolf Jondolf merged commit b8cb5bf into main Sep 30, 2025
6 checks passed
@Jondolf Jondolf deleted the fix-sleeping-component branch September 30, 2025 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Dynamics Relates to rigid body dynamics: motion, mass, constraint solving, joints, CCD, and so on C-Bug Something isn't working C-Usability A quality-of-life improvement that makes Avian easier to use

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant