4 Portals
Schnappy edited this page 2021-06-22 20:22:03 +02:00

Portals are used when enabling the pre-calculated backgrounds export option.



Their purpose is to determine when to switch the camera angle / background depending on the actor's world position.

They should be a quad plane perpendicular to the ground plane.

The way it works is :

  • Only keep the two portals closest to the camera in world space coordinates.
  • Determine which is on the left of the screen and which is on the right.
  • Check whether the actor is in the screen space delimited by each of the planes.
  • If so, and in left plane, switch to previous camera, else switch to next camera.

You can deduce from these steps that the camera position are considered from left to right on the world's X axis.