Skip to content

Conversation

@ryevdokimov
Copy link
Contributor

This is unnecessary overhead because static bodies don't have motion properties. They only affect dynamic bodies through contact resolution.

As an example of where this change benefits is a scene with several conveyors constantly and rapidly changing velocities.

@ryevdokimov ryevdokimov requested a review from a team as a code owner November 9, 2025 00:19
@Mickeon Mickeon requested a review from mihe November 9, 2025 00:40
@Mickeon Mickeon added this to the 4.6 milestone Nov 9, 2025
@mihe
Copy link
Contributor

mihe commented Nov 10, 2025

I'm curious what prompted this change. Are you seeing something show up in some profiler?

This is already being filtered out inside of Jolt, so shouldn't be that impactful I feel like:

if (!body.IsStatic())
{
// Reset sleeping timer so that we don't immediately go to sleep again
body.ResetSleepTimer();
// Check if we're sleeping
if (body.mMotionProperties->mIndexInActiveBodies == Body::cInactiveIndex)
{
AddBodyToActiveBodies(body);
// Call activation listener
if (mActivationListener != nullptr)
mActivationListener->OnBodyActivated(body_id, body.GetUserData());
}
}
}

@ryevdokimov
Copy link
Contributor Author

You're right. I had noticed some slowdowns in a specific test scene and wrongly attributed an improvement to this, but it was because of the removal of so other debug garbage I had 😵‍💫. After double checking with a profiler this change is pretty meaningless.

@ryevdokimov ryevdokimov deleted the keep-dreaming branch November 10, 2025 16:28
@mihe mihe removed this from the 4.6 milestone Nov 10, 2025
@mihe mihe added the archived label Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants