I read up some infos on physics simulations and found a possible solution. It works by splitting each physics-step into three phases:
Each physics-step, a window creates four transformations,
two for each side of the connection:
- an input transformation that transforms an object's position, velocity
(and possibly size and weight) into the destination coordinate-system and
- an output transformation that transforms forces back into the object's original system.
(Static windows only need to do this once.)
Additionally, objects in each coordinate-system are split into three groups:
Objects in front of the window (green).
An object is also counted towards this group if it is intersecting the window plane or likely to cross it from behind the window (not shown).
Objects intersecting the window or likely to intersect it in this physics-step (orange).
Objects behind the window (blue).
If an objects flies towards the back-side of the window, it is still marked as member of group three.
Grouping can be simplified if the window is at the simulation's border.
Physics are calculated mostly as usual, with a few exceptions:
Objects from the second group never collide with those from the third and vice-versa.
The window's input transformation is used on the objects from the second group
and the results are evaluated against the front- and intersecting objects
from the destination system. The resulting force is transformed using the output transformation and applied to the original object.
(If an object is hit during the calculation, it must be regrouped!)
If an object from the second group has crossed the window, it is moved into the destination system using the input transformation.
If the transformations are preserved after calculating the physics, they can be used to speed up rendering and for easier AI calculations. The grouping could be used to remove clip-planes from the rendering process.
The downside of this solution is that the windows have to be added directly into the physics-engine.