Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Diff: Renderer/Renderer.h
- Revision:
- 36:6fbafc8bed80
- Parent:
- 35:fe3956825bd8
- Child:
- 37:524b91130885
--- a/Renderer/Renderer.h Mon Apr 29 14:53:36 2019 +0000 +++ b/Renderer/Renderer.h Mon Apr 29 14:58:59 2019 +0000 @@ -20,37 +20,35 @@ Cube selectionCube; public: Renderer(); - void init(); /** Initialises the LCD and sets the field of view */ - float xTo2D(float x, float z); + void init(); /** Projects the 3D x coordinate to 2D perspective *@param The 3d x coordinate as a float *@param The 3d z coordinate as a float *@returns The 2D perspective fo the x coordinate */ - float yTo2D(float y, float z); + float xTo2D(float x, float z); /** Projects the 3D y coordinate to 2D perspective *@param The 3d y coordinate as a float *@param The 3d z coordinate as a float *@returns The 2D perspective of the y coordinate */ - void drawHorizon(float angle); + float yTo2D(float y, float z); /** Draws the games horizon line *@param The angle of the horizon determined by the joystick position */ + void drawHorizon(float angle); + /** Draw an individual face + *@param The face object + *@param The angle of the face object as a float + */ void drawFace(Face *face, float angle); /** Draw an individual face *@param The face object *@param The angle of the face object as a float */ void rasterizeFace(float (&points)[4][3], Face *face); - /** Fill in the face - *@param The pointer to an array containing the verticies of the face - *@param The face object - */ - void drawFillLines(float (&points)[4][3], int diffX2, int stepBottomY, - int stepTopX, int stepTopY); /** Draw an individual face *@param The pointer to an array containing the verticies of the face *@param The integer difference between the top horizontal edge x coordinates @@ -58,74 +56,76 @@ *@param The integer difference between bottom horizontal edge x coordinates *@param The integer difference between left horizontal edge y coordinates */ - void drawFaceOutline(float (&points)[4][3]); + void drawFillLines(float (&points)[4][3], int diffX2, int stepBottomY, + int stepTopX, int stepTopY); /** Draw the outline of the face *@param The pointer to an array containing the verticies of the face */ - void drawAllFaces(Face *faceArray, int noOfFaces, float angle); + void drawFaceOutline(float (&points)[4][3]); /** Draw all faces within a face array *@param The pointer to an array of face objects *@param The number of faces as an integer *@param The angle of the faces as a float */ - bool checkOnScreen(float (&Points)[4][3]); + void drawAllFaces(Face *faceArray, int noOfFaces, float angle); /** Checks whether any area of the face is on the screen *@param The pointer to an array containing the verticies of the face */ - void print(const char *text, int x, int y); + bool checkOnScreen(float (&Points)[4][3]); /** Prints a string at a desired location on the screen *@param The pointer to an array of characters of the string *@param The x coordinate to draw the string as an integer *@param The y coordinate to draw the string as an integer */ - void printScore(int score, int x, int y); + void print(const char *text, int x, int y); /** Prints a score at a desired location on the screen *@param The value of the score as an integer *@param The x coordinate to draw the score as an integer *@param The y coordinate to draw the score as an integer */ + void printScore(int score, int x, int y); + /** Clears the display + */ void clear(); - /** Clears the display + /** Refreshes the display */ void refresh(); - /** Refreshes the display + /** Turns off the display */ void turnOff(); - /** Turns off the display - */ - void drawDeathScreen(int selection, int highScore); /** Draws the screen after the user has collided with a cube *@param The selected option as an integer *@param The high score as an integer */ - void drawDeathButtons(); + void drawDeathScreen(int selection, int highScore); /** Draws the death menus buttons */ - void drawHomeScreen(int selection); + void drawDeathButtons(); /** Draws the games home screen *@param The selected option as an integer */ - void drawHomeButtons(); + void drawHomeScreen(int selection); /** Draws the home menus buttons */ - void drawSelectionCube(int x, int y, int z, int rotationSpeed); + void drawHomeButtons(); /** Draws the cube which indicates the selected button on the menus *@param The x coordinate of where to draw the cube as an integer *@param The y coordinate of where to draw the cube as an integer *@param The z coordinate of where to draw the cube as an integer *@param The rotation speed multiplier of the cube as an integer */ - void drawHelpScreen1(); + void drawSelectionCube(int x, int y, int z, int rotationSpeed); /** Draws the first help screen */ + void drawHelpScreen1(); + /** Draws the second help screen + */ void drawHelpScreen2(); - /** Draws the second help screen + /** Draws the third help screen */ void drawHelpScreen3(); /** Draws the third help screen */ void drawHelpScreen4(); - /** Draws the fourth help screen - */ };