Bigger Suggestion: Per-space settings

Post and discuss features you'd like to see in the BEPUphysics library.
Post Reply
mcmonkey
Posts: 89
Joined: Fri Apr 17, 2015 11:42 pm

Bigger Suggestion: Per-space settings

Post by mcmonkey » Sun Jun 25, 2017 4:50 am

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...

Norbo
Site Admin
Posts: 4485
Joined: Tue Jul 04, 2006 4:45 am

Re: Bigger Suggestion: Per-space settings

Post by Norbo » Sun Jun 25, 2017 7:46 pm

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.

mcmonkey
Posts: 89
Joined: Fri Apr 17, 2015 11:42 pm

Re: Bigger Suggestion: Per-space settings

Post by mcmonkey » Mon Jun 26, 2017 2:18 am

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!

Norbo
Site Admin
Posts: 4485
Joined: Tue Jul 04, 2006 4:45 am

Re: Bigger Suggestion: Per-space settings

Post by Norbo » Mon Jun 26, 2017 5:13 am

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.

mcmonkey
Posts: 89
Joined: Fri Apr 17, 2015 11:42 pm

Re: Bigger Suggestion: Per-space settings

Post by mcmonkey » Mon Jun 26, 2017 5:22 am

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

Norbo
Site Admin
Posts: 4485
Joined: Tue Jul 04, 2006 4:45 am

Re: Bigger Suggestion: Per-space settings

Post by Norbo » Mon Jun 26, 2017 4:12 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest