Skip to navigation

Landscape: tileEdges

Name: tileEdges [Show more] Type: Variable Category: Landscape Summary: A table to map tile shapes and gaze vector direction to tile edges
Context: See this variable in context in the source code References: This variable is used as follows: * FollowGazeVector (Part 4 of 5) uses tileEdges

This table contains tile corner numbers from a tile: ^ [1] [2] | | [0] [3] z-axis into screen x-axis from left to right ---> Each tile corner number represents an edge from the number to the number + 1, so 1 represents the edge from corner 1 to corner 2, for example. The table is used to work out which edge should be chosen for the calculation in the FollowGazeVector routine, where we work out whether the gaze vector is hitting a tile slope in a tile with two horizontal edges. See part 4 of the FollowGazeVector routine for details of how this table works.
.tileEdges EQUB 0, 3 \ Left and bottom edges (G = 0) \ \ First entry (left edge) for xCoordLo < zCoordLo \ \ Second entry (bottom edge) for xCoordLo >= zCoordLo EQUB 1, 0 \ Top and left edges (G = 1) \ \ First entry (top edge) for ~xCoordLo < zCoordLo \ \ Second entry (left edge) for ~xCoordLo >= zCoordLo EQUB 1, 2 \ Top and right edges (G = 2) \ \ First entry (top edge) for xCoordLo < zCoordLo \ \ Second entry (right edge) for xCoordLo >= zCoordLo EQUB 2, 3 \ Right and bottom edges (G = 3) \ \ First entry (right edge) for ~xCoordLo < zCoordLo \ \ Second entry (bottom edge) for ~xCoordLo >= zCoordLo