Page 1 of 1

Bigger Suggestion: Per-space settings

Posted: Sun Jun 25, 2017 4:50 am
by mcmonkey
There are a few things (in particular settings classes) that appear to be global... I think they would benefit from being per-space.

Take for example: CollisionDetectionSettings.AllowedPenetration

This setting is one of a few that are very important to modify when shifting the scale of a world (as an alternative to having a linear scaling factor to convert between physics and general coordinates)

If you want to have a big-object space and a small-object space in one executable run... well, you can't to my knowledge, thanks to a few things like this seeming to be global.

Many settings are per-space already, so I'm unclear as to why some aren't...

Re: Bigger Suggestion: Per-space settings

Posted: Sun Jun 25, 2017 7:46 pm
by Norbo
The reason isn't great- it is just a bit ugly to pass around the necessary context to all the different bits and pieces that require it in v1's design. Being able to go grab a global is just easier.

That's definitely not ideal, and unfortunately, it's not really worth it to fix it in v1.

On the upside, v2 goes a long way in this regard. The only global state so far (constraint type ids) can't really cause issues for multiple simulations, and I'll probably end up removing it anyway if I can come up with a simpler approach with no performance impact.

And this isn't just a matter of hiding the variables elsewhere- there are far fewer tuning variables. I really don't want people to ever need to think about allowed penetration, default collision margins, maximum contact distances, invalidation thresholds, GJK/MPR termination epsilons, simulation scale and all these other things. So far, it looks like all of those will just be gone. Collision response rigidity and CCD can still be tuned, but that's now on a per-collidable basis.

Re: Bigger Suggestion: Per-space settings

Posted: Mon Jun 26, 2017 2:18 am
by mcmonkey
Are you saying that in v2, the setting will automatically or at least more easily correct itself for unusually scaled space?

If so, that'd be really amazing!

Re: Bigger Suggestion: Per-space settings

Posted: Mon Jun 26, 2017 5:13 am
by Norbo
The goal is that there won't be any settings that need tuning, automatic or not- the underlying algorithms just won't rely on fiddly little epsilons and margins. If it turns out I need to use epsilons here or there (more likely in convex sweep tests than main contact generation), they'll be auto-tuned.

Re: Bigger Suggestion: Per-space settings

Posted: Mon Jun 26, 2017 5:22 am
by mcmonkey
First:
That sounds really great! Can't wait for that :)

But also:

You underestimate my ability to break things while seemingly using them as normal :P

Re: Bigger Suggestion: Per-space settings

Posted: Mon Jun 26, 2017 4:12 pm
by Norbo
You underestimate my ability to break things while seemingly using them as normal :P
8)