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.
Diff: Mechanics/Mechanics.h
- Revision:
- 9:7b1093d3f03a
- Parent:
- 7:2ce6e90f6d47
- Child:
- 11:7b12992156de
--- a/Mechanics/Mechanics.h Mon Mar 02 18:11:04 2020 +0000 +++ b/Mechanics/Mechanics.h Thu Mar 05 15:40:21 2020 +0000 @@ -73,12 +73,12 @@ class Mechanics { public: - int Get_Gate(Square_2D gates[], int number_of_gates, Point_2D position, int current_gate); - int Get_Laps(int laps, Square_2D gates[], int number_of_gates, Point_2D position, int current_gate); + int Get_Gate(const Square_2D gates[], int number_of_gates, Point_2D position, int current_gate); + int Get_Laps(int laps, const Square_2D gates[], int number_of_gates, Point_2D position, int current_gate); Time Convert_To_Time(int game_fps, int number_of_frames); int Get_Angle(int angle, int handling, bool gyro_enabled, FXOS8700CQ &Gyro, Gamepad &Device); - Point_2D Get_Translation(Point_2D in, float angle, float speed, Square_2D *out_of_bounds_square, Triangle_2D *out_of_bounds_triangle, Map_Data map_info, Gamepad &Device); + Point_2D Get_Translation(Point_2D in, float angle, float speed, const Square_2D *out_of_bounds_square, const Triangle_2D *out_of_bounds_triangle, const Map_Data map_info, Gamepad &Device); float Get_Speed( float speed, @@ -87,12 +87,12 @@ float deceleration, float off_track_speed, Point_2D position, - Square_2D *offtrack_square, - Triangle_2D *offtrack_triangle, - Square_2D *out_of_bounds_square, - Triangle_2D *out_of_bounds_triangle, - Triangle_2D *plates, - Map_Data map_info, + const Square_2D *offtrack_square, + const Triangle_2D *offtrack_triangle, + const Square_2D *out_of_bounds_square, + const Triangle_2D *out_of_bounds_triangle, + const Triangle_2D *plates, + const Map_Data map_info, Gamepad &Device ); @@ -104,13 +104,13 @@ private: //SPEED - bool Is_Offtrack(Point_2D position, Square_2D offtrack_square[], Triangle_2D offtrack_triangle[], Map_Data map_info); - bool Is_Out_Of_Bounds(Point_2D position, Square_2D offtrack_square[], Triangle_2D offtrack_triangle[], Map_Data map_info); - bool Is_Offtrack_Square(Square_2D offtrack[], int size, Point_2D position); - bool Is_Offtrack_Triangle(Triangle_2D offtrack[], int size, Point_2D position); - bool Is_Out_Of_Bounds_Square(Square_2D out_of_bounds[], int size, Point_2D position); - bool Is_Out_Of_Bounds_Triangle(Triangle_2D out_of_bounds[], int size, Point_2D position); - float Get_Boost_Speed(Triangle_2D plates[], int number_of_plates, Point_2D position, float speed); + bool Is_Offtrack(Point_2D position, const Square_2D offtrack_square[], const Triangle_2D offtrack_triangle[], const Map_Data map_info); + bool Is_Out_Of_Bounds(Point_2D position, const Square_2D offtrack_square[], const Triangle_2D offtrack_triangle[], const Map_Data map_info); + bool Is_Offtrack_Square(const Square_2D offtrack[], int size, Point_2D position); + bool Is_Offtrack_Triangle(const Triangle_2D offtrack[], int size, Point_2D position); + bool Is_Out_Of_Bounds_Square(const Square_2D out_of_bounds[], int size, Point_2D position); + bool Is_Out_Of_Bounds_Triangle(const Triangle_2D out_of_bounds[], int size, Point_2D position); + float Get_Boost_Speed(const Triangle_2D plates[], int number_of_plates, Point_2D position, float speed); };