Simulating a Mirror

From SIMboxWiki
Jump to navigation Jump to search

The following method is suggested to simulate a mirror display:

1. Render the world in the opposite direction of the cockpit using a Video Camera.
2. Attach the video camera to an AGI.
3. Limit the size of the AGI either using a texture mask or a clip mask (see Fitting an AGI to a Gauge).
4. Flip the AGI or the image horizontally (assuming you rotated the camera backwards using yaw) using either Agi::Scale() with -1 as the horizontal scale or Agi::FlipBitmap().

Two items to note:
1. If you have more than one mirror, it is advised that you use the same video camera on both to save performance.
2. The result of the above steps won't truly simulate how mirrors work. Mirrors reflect things relative to the position of the eye (i.e. camera) from the mirror. If you want to take this into account, you will have to add the necessary calculations and you will not be able to use the same video camera for multiple mirrors.