Cells and portals: the rooms of an inside level (sections CELL and PRTL, see Documentation/level_format.md).
More...
Go to the source code of this file.
Cells and portals: the rooms of an inside level (sections CELL and PRTL, see Documentation/level_format.md).
- Author
- Johannes Fetz
- A cell is a room: its model (walls, floor, ceiling in world coordinates, the light baked in the colors of the vertices) and a box where the player can walk, with a flat floor or a slope (stairs)
- The cells overlap at the doors: a position is walkable when a circle around it is in the box of a cell
- Drawing: the cell of the camera, then the cells seen through its portals (the rectangle of a portal on the screen gets smaller at each portal: a cell behind 2 doors is drawn only if both doors are seen). Each polygon costs CPU time: the rooms behind the walls are not drawn