Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speculative contact distance affects sensors #818

Closed
mihe opened this issue Dec 23, 2023 · 1 comment · Fixed by #829
Closed

Speculative contact distance affects sensors #818

mihe opened this issue Dec 23, 2023 · 1 comment · Fixed by #829

Comments

@mihe
Copy link
Contributor

mihe commented Dec 23, 2023

I stumbled upon the workaround that I put in for this in godot-jolt/godot-jolt#613 and figured you might appreciate an official issue for it.

As mentioned in the PR linked above, it appears that PhysicsSettings::mSpeculativeContactDistance affects the distance by which sensors will detect other bodies.

The repro is fairly straight forward. Simply add this to the bottom of SensorTest::Initialize:

PhysicsSettings settings = mPhysicsSystem->GetPhysicsSettings();
settings.mSpeculativeContactDistance = 2.0f;
mPhysicsSystem->SetPhysicsSettings(settings);

Obviously that is a very extreme value, but when running SensorTest with those changes you should hopefully see that bodies which clearly aren't within any sensor still gets the bounding box drawn around them.

(Happy holidays to you and yours by the way, and to any of you watchers out there! 🎅)

@jrouwe
Copy link
Owner

jrouwe commented Dec 23, 2023

Thanks for the report! I had completely forgotten about this. I remember looking into it but I don't remember what the conclusion was anymore (I should have written it down).

Happy holidays to you too! Keep those trackers coming in the next year, we've done really great teamwork together!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants