Skip to navigation


Track geometry: UpdateCurveVector

Name: UpdateCurveVector [Show more] Type: Subroutine Category: Track geometry Summary: Move to the next segment vector along in the direction we are facing, but only for curved track sections Deep dive: Building a 3D track from sections and segments
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * GetTrackSegment (Part 3 of 3) calls UpdateCurveVector * TurnPlayerAround calls UpdateCurveVector
.UpdateCurveVector LDA thisSectionFlags \ If bit 0 of the track section's flag byte is clear, AND #1 \ then this is a straight track section, so return from BEQ ChangeDirection-1 \ the subroutine (as ChangeDirection-1 contains an RTS) \ Otherwise this is a curved track section, so fall \ through into UpdateVectorNumber to update the value \ of thisVectorNumber to the number of the next vector \ along the track