Skip to navigation

Revs on the BBC Micro

Track geometry: GetSegmentYawAngle

Name: GetSegmentYawAngle [Show more] Type: Subroutine Category: Track geometry Summary: Calculate the difference in yaw angle between a track segment and the player
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * GetSegmentAngles (Part 1 of 3) calls GetSegmentYawAngle * GetSegmentAngles (Part 2 of 3) calls GetSegmentYawAngle

Arguments: X The offset from xSegmentCoordILo of the segment's 3D coordinates, i.e. the segment number * 3, with: * X for inner track segment coordinates * X + 120 for outer track segment coordinates segmentListPointer The index of the segment in the track segment list to use for calculations
Returns: (L K) The distance between the object and the player's car A Contains the high byte of (L K)
.GetSegmentYawAngle JSR GetObjYawAngle-2 \ Calculate the segment's yaw angle, from the point of \ view of the player, returning it in (JJ II) LDY segmentListPointer \ Set Y = segmentListPointer, so the result gets stored \ in the correct position in the track segment list \ Fall through into GetSectionYawAngle to set the \ specified xVergeRight or xVergeLeft to the difference \ in the yaw angle between the player and the segment