Slow Motion On Subset Of Objects

Hey guys, I know there's been a couple of topics on the subject of slow motion that I've read through but my use case is a little bit more strange.

What we want to do is be able to have a subset of the objects in the world be in slow motion while others aren't. I realize you could probably have separate worlds with different timesteps, but I expect some of these slow/normal objects may interact with each other, and this approach would almost certainly make that more complicated. We did consider modifying the source code to allow a more granular timestep control so we could set certain objects to follow one delta while others follow another all within the same world, but we'd prefer not to modify the source if possible.

Does anyone have any good ideas for approaching this?
I'm not sure about how viable this is, but my initial impression is you could just treat the slowmotion objects differently. It would require considering the different ways that a change in timestep would affect bodies, but before looking into that i wonder if maybe it's important to first consider how to deal with the consequences of certain situations:

Here is a non-paradoxical situation: 1D elastic billiard ball dynamics -- if the cue ball is slow motion and strikes a regular ball, what is it supposed to look like? Does the slowmo affect the imparted momentum? It must not in order to conserve momentum (which means the resulting velocity of the ball that is hit is the same regardless of whether the cueball exits slomo before or after the impact).

A paradoxical situation: A large massive object that isn't in slowmotion pushes against a slowmotion body. The slowmotion body has to move slower than the thing it's being pushed by. Should that cause it to penetrate the non-slow pusher body? Should it temporarily gain speed? But then it would have gained too much speed upon exiting slowmotion. So you have to at some point define how to treat the notion of velocity itself in a world where some objects travel through time differently.

I would probably be tweaking the box2d source code, to be honest. But even if you don't do that, it is conceivable to try to manage it manually. Any slomo bodies will get their velocities altered appropriately upon entering/exiting slomo, and any and all forces acting upon them (gravity in particular) must also be scaled by the slowing factor whenever slomo is active. It's a bit unclear (and still would be unclear in the case of special timestep behavior for slomo enabled bodies) how collision resolution should proceed.

I would say it's much easier to maintain sane physics (causality, conservation of momentum, etc.) if you just keep the time dilation as a global parameter that affects everything.

However, it would be very interesting and fun I think if the paradoxes could be worked out because I would love to be able to see lifelike interactions between objects that appear to travel through time at different rates. Maybe even a game that has puzzles that depend on various paradoxical situations that arise.

Original thread: https://box2d.org/forum/viewtopic.php?t=9953