.umod15 LDY #2 \ We now set up the matrices, starting with the \ projected rotation angles, which we populate one axis \ at a time, so set a counter in Y to work through the \ three axes .umod16 STY matrixAxis \ Set matrixAxis to the current axis in Y, to pass to \ ProjectAxisAngle JSR ProjectAxisAngle \ Convert the rotation angles of the plane in axis Y to \ coordinates that we can use to populate the matrices \ in the call to SetMatrices LDY matrixAxis \ Restore the axis counter that we stored above DEY \ Decrement the axis counter in Y BPL umod16 \ Loop back until we have processed all three axes LDA #0 \ Set matrixNumber = 0 to pass to SetMatrices, so we STA matrixNumber \ set the values for matrices 1 to 4 STA matrixAxis \ Set matrixAxis = 0 to pass to SetMatrices, so we set \ the three standard axes in matrices 1 to 4 JSR SetMatrices \ Set up the four rotation matrices JSR ApplyFlightModel \ Apply the flight model to our plane JSR UpdateDashboard \ Update the next two indicators in the ranges 0 to 6 \ and 7 to 11 JSR UpdateDash7To11 \ Update the next indicator in the range 7 to 11 RTS \ Return from the subroutineName: UpdateFlightModel (Part 4 of 4) [Show more] Type: Subroutine Category: Flight model Summary: Set up matrices, apply the flight model and update the dashboardContext: See this subroutine in context in the source code References: No direct references to this subroutine in this source file
[X]
Subroutine ApplyFlightModel (Part 1 of 7) (category: Flight model)
Apply the flight model to the plane, starting by calculating the effect of gravity and the undercarriage springs
[X]
Subroutine ProjectAxisAngle (category: 3D geometry)
Convert the rotation angles of the plane into coordinates
[X]
Subroutine SetMatrices (category: 3D geometry)
Set up matrices 1 to 4
[X]
Entry point UpdateDash7To11 in subroutine UpdateDashboard (category: Dashboard)
Update the next indicator in the range 7 to 11
[X]
Subroutine UpdateDashboard (category: Dashboard)
Update two indicators on the dashboard, one from 0-6, one from 7-11, cycling through them with each subsequent call
[X]
Variable matrixAxis in workspace Main variable workspace
The axis to be processed by the matrix routines, specifically those that populate the matrices
[X]
Variable matrixNumber in workspace Main variable workspace
The matrix used in matrix operations
[X]
Label umod16 is local to this routine