.GetSectionYawAngle LDA II \ Set the following for the Y-th section: SEC \ SBC playerYawAngleLo \ xVergeRight = (JJ II) - playerYawAngle STA xVergeRightLo,Y \ \ starting with the low bytes LDA JJ \ And then the high bytes SBC playerYawAngleHi STA xVergeRightHi,Y JMP GetObjectDistance \ Set (L K) to the distance between the object and the \ player's car, with A set to L, returning from the \ subroutine using a tail callName: GetSectionYawAngle [Show more] Type: Subroutine Category: Track geometry Summary: Calculate the difference in yaw angle between an object and the playerContext: See this subroutine in context in the source code References: This subroutine is called as follows: * GetSectionAngles (Part 3 of 3) calls GetSectionYawAngle
This routine is typically used to calculate the difference in yaw angle between a track section and the player.
Arguments: Y Index from xVergeRight to store the difference in yaw angle between the object and the player (JJ II) The yaw angle of the object
Returns: xVergeRight The difference in the yaw angle between the object and the player (if Y points to the right verge) xVergeLeft The difference in the yaw angle between the object and the player (if Y points to the left verge) (L K) The distance between the object and the player's car A Contains the high byte of (L K) M The smaller yaw angle of the object, where 0 to 255 represents 0 to 45 degrees
[X]
Subroutine GetObjectDistance (category: 3D objects)
Calculate the distance between an object and the player's car, for collision purposes
[X]
Variable playerYawAngleHi in workspace Zero page
High byte of the player's yaw angle
[X]
Variable playerYawAngleLo in workspace Zero page
Low byte of the player's yaw angle
[X]
Variable xVergeRightHi (category: Track geometry)
High byte of segment yaw angles along the right track verge in front of the player (i.e. along the x-axis)
[X]
Variable xVergeRightLo (category: Track geometry)
Low byte of segment yaw angles along the right track verge in front of the player (i.e. along the x-axis)