@pixi/3d
    Preparing search index...

    Function mirrorCameraThroughPortal

    • Advanced

      Poses a portal camera behind the exit exactly as the viewer stands before the entry

      A portal faces its local +Z, as an unrotated PlaneGeometry does: the entry's +Z side holds the viewer, and the exit's holds the room the portal shows. The result is exit · turnAround · entry⁻¹ · viewer, where turnAround is a half-turn about the portal's up axis, so a viewer d in front of the entry lands d behind the exit, looking out through it.

      A scale on one portal node that the other doesn't share carries into the camera, so give both the same scale.

      Parameters

      • entryWorld: Matrix4

        World transform of the portal the viewer is looking at.

      • exitWorld: Matrix4

        World transform of the portal on the far side.

      • viewerWorld: Matrix4

        World transform of the camera doing the looking.

      • out: Matrix4 = ...

        Matrix to write the portal camera's world transform into.

      Returns Matrix4

      The written matrix.