Skip to navigation

Maths (Geometry): FollowGazeVector (Part 3 of 5)

Name: FollowGazeVector (Part 3 of 5) [Show more] Type: Subroutine Category: Maths (Geometry) Summary: Calculate whether the viewing object's gaze is obstructed by a tile of shape 4 or 12 (i.e. a tile with one horizontal edge)
Context: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
\ If we get here then the tile shape is 4 or 12, so the \ tile has one horizontal edge with the other two points \ being arbitrary (but not at the same height as the \ horizontal edge) LDA yCoordHi \ If yCoordHi is higher than any of the four tile CMP S \ corners, then the current position along the viewer's BCS gaze7 \ gaze is above the tile surface, so jump to gaze1 via CMP T \ gaze7 to move along the gaze vector and restart the BCS gaze7 \ checks CMP U BCS gaze7 CMP V BCS gaze7 JMP gaze4 \ Otherwise the current position along the viewer's \ gaze is below the height of at least one tile corner, \ so we consider this to be enough interference to be \ blocking the viewer's gaze of any tiles that might be \ partially visible beyond (which might be possible if \ the slope is from left to right, for example) \ \ So jump to gaze4 to return from the subroutine with \ the C flag set to indicate that the viewer is not \ looking at a tile .gaze7 JMP gaze1 \ Jump to gaze1 to move along the gaze vector and \ restart the checks (this jump point is for use by \ branching instructions)