# Development and Validation of a System for Game Control Based on a Force Plate
## 3 Mathematical Model of the System
### System Calibration and Game Control
Controlling games by using mouse cursor movements and left mouse button clicking is performed in a different way compared with using just the keyboard, as shown in Table 1. Table 2 shows the conditions for clicking the left mouse button, and it is equivalent to the condition for pressing the SPACE key. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Condition for Pressing a Key** & **True Condition** & **False Condition** \\ \hline if (\(G_{CoP}^{y}>y_{TH}\)) & Press UP & Release UP \\ if (\(G_{CoP}^{z}<-y_{TH}\)) & Press DOWN & Release DOWN \\ if (\(G_{CoP}^{z}>x_{TH}\)) & Press RIGHT & Release RIGHT \\ if (\(G_{CoP}^{z}<-x_{TH}\)) & Press LEFT & Release LEFT \\ if (\(\tilde{z}_{CoM}>q_{TH}\)) & Press LEFT & Release LEFT \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Conditions for pressing a key on the keyboard. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Condition for Clicking a Button** & **True Condition** & **False Condition** \\ \hline if (\(\tilde{z}_{CoM}>q_{TH}\)) & Press Left Mouse Button & Release Left Mouse Button \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Conditions for clicking the left mouse button. Movement of the mouse cursor is simulated using the player's CoP position in the local frame {G} by linearly transforming the CoP position into the mouse cursor position on screen, as shown by the following expression:  
\[\left[ \begin{array}{c}x_{mouse}\\ y_{mouse}\end{array} \right]=\left[ \begin{array}{cc}\frac{X_{RES}}{200}&0\\ 0&\frac{Y_{RES}}{200}\end{array} \right]^{\mathrm{G}}\mathbf{CoP}+\left[ \begin{array}{c}\frac{X_{RES}}{2}\\ \frac{Y_{RES}}{2}\end{array} \right] \tag{13}\]  
where the following are true:  
* \(x_{mouse}\) is the mouse cursor position along the \(x\) axis;
* \(y_{mouse}\) is the mouse cursor position along the \(y\) axis;
* \(X_{RES}\) is the horizontal screen resolution;
* \(Y_{RES}\) is the vertical screen resolution. In Equation (13), aside from scaling the CoP position, a translation of the {G} origin into the screen origin has been carried out, which is in the lower left corner. According to the derived mathematical model for the game control system, the force plate measures the player's CoP position in the frame {O}, which is shown in the local frame {H} via the relation in Equation (6). The CoP position in the local frame {H} is translated into the CoP position in the local frame {G} with the help of the relation in Equation (10). Depending on the CoP values in the local frame {G}, a decision is made for pressing the UP, DOWN, RIGHT, and LEFT keyboard keys or moving the mouse cursor. Detecting the acceleration of the player's CoM along the \(z\) axis, which is caused by performing impulse half squats, is used to control pressing the SPACE keyboard key or clicking the left mouse button. To conclude, changing the player's CoP and accelerating the player's CoM along the \(z\) axis enables the simulation of pressing the UP, DOWN, RIGHT, LEFT, and SPACE keyboard keys or moving the mouse cursor and clicking the left mouse button to enable controlling games.