From 22c2303bcac053e26a20e9032351e2ad7ce77c5b Mon Sep 17 00:00:00 2001 From: GamerMan7799 Date: Thu, 21 Mar 2019 16:18:57 -0400 Subject: [PATCH 1/6] Update to v1.4.1-beta.1 ## [1.4.1-beta.1] - 2019-03-21 ### Added * Math function specifically to deal with vector math. ### Fixed * Spelling mistakes ### Notes * Update is pretty pointless but I wanted to update something, since it's been almost a year. --- README.md | 8 +-- docs/CONTRIBUTING.md | 2 +- docs/ChangesLog.md | 23 ++++++--- project/Physics-Simulator.cbp | 2 + src/cannonball.cpp | 32 ++++-------- src/cannonball.h | 12 +---- src/core.cpp | 22 ++++----- src/rope.cpp | 6 +-- src/vector_math.cpp | 92 +++++++++++++++++++++++++++++++++++ src/vector_math.h | 36 ++++++++++++++ src/version.h | 18 +++---- 11 files changed, 181 insertions(+), 72 deletions(-) create mode 100644 src/vector_math.cpp create mode 100644 src/vector_math.h diff --git a/README.md b/README.md index 3b23931..1b91208 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ There are a few branches of this that use different programming languages. # License This program has been released in the Public Domain meaning you can use it however you wish, read the license file [here](https://github.com/Dragon-Wonder/Physics-Collision-Simulator/blob/master/docs/LICENSE.md) -or you can read [here](http://unlicense.org) for infomation of the Unlicense in general. +or you can read [here](http://unlicense.org) for information of the Unlicense in general. ## Summary of what license means @@ -17,7 +17,7 @@ or you can read [here](http://unlicense.org) for infomation of the Unlicense in * You can modify this code any way you wish without credit (but we would certainty appreciate it) -* You can any/all of this code for private and/or commerical use +* You can any/all of this code for private and/or commercial use # Running the program @@ -38,7 +38,7 @@ FolderName\SDL2.dll FolderName\SDL2_image.dll ``` -If you are using the verision I compile, which can be found in the [release tab](https://github.com/Dragon-Wonder/Physics-Collision-Simulator/releases) +If you are using the version I compile, which can be found in the [release tab](https://github.com/Dragon-Wonder/Physics-Collision-Simulator/releases) you will also need the following binaries. ``` @@ -145,4 +145,4 @@ Clicking and dragging on a ball will allow you to move a ball where the mouse is ### Info Tool -Clicking on a ball will write infomation about it to the console +Clicking on a ball will write information about it to the console diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index bf36733..9a17ee1 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -7,5 +7,5 @@ Contribute what you want. More or less the Google Style which can be found [here](https://google.github.io/styleguide/cppguide.html) -Some expections exist, but they are mostly because of old formatting that hasn't been updated yet. +Some exceptions exist, but they are mostly because of old formatting that hasn't been updated yet. diff --git a/docs/ChangesLog.md b/docs/ChangesLog.md index 5575933..bafbe8d 100644 --- a/docs/ChangesLog.md +++ b/docs/ChangesLog.md @@ -3,6 +3,13 @@ All notable changes to this project will be documented here. This project adheres to [Semantic Versioning](http://semver.org/) +## [1.4.1-beta.1] - 2019-03-21 +### Added +* Math function specifically to deal with vector math. + +### Fixed +* Spelling mistakes + ## [1.4.0-R] - 2018-03-27 ### Added * Toolbar with different tools including: drag, fire, drop, rope, delete, and info. (Issue #5) @@ -12,7 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) * More Doxygen stuff. * Debug message that prints ball mass when created. * Ability to pause the simulation. -* Changable Ratio of meters to Pixels (default is 10 pixels/meter) +* Changeable Ratio of meters to Pixels (default is 10 pixels/meter) ### Changed * Moved Docs to Doc folder. @@ -25,7 +32,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) * Floors to casts (due to large number of calls of the floor functions). ### Removed -* Interia/engergy from spins, because it did nothing. +* Inertia/energy from spins, because it did nothing. ### Fixed * Bug of balls getting stuck in walls. @@ -42,7 +49,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) ## [1.3.0-R] - 2018-03-06 ### Added -* Interia/energy from spins. +* Inertia/energy from spins. ### Notes * Pretty pointless addition, just wanted to add something since its been a year. @@ -60,7 +67,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) ### Updated * Drag equation. -* System is force based instead of acceleation. +* System is force based instead of acceleration. ## [1.1.2-R] - 2017-02-24 @@ -98,7 +105,7 @@ This project adheres to [Semantic Versioning](http://semver.org/) * Max number of past points is now a config value. ### Notes -* There are still quite a few non-standard elements left from before I started using Google's style guide consistantly. +* There are still quite a few non-standard elements left from before I started using Google's style guide consistently. I changed the worst offending members, but most of the rest of it will be left. ## [1.0.0-RC] - 2015-11-21 @@ -133,8 +140,8 @@ This project adheres to [Semantic Versioning](http://semver.org/) * Made most lines to be less than 80 charaters. ### Cleaned -* Depencies on header files. -* Depencies on exteral libraries. +* Dependencies on header files. +* Dependencies on external libraries. ### Added * More doxygen comments that I missed before. @@ -465,4 +472,4 @@ This project adheres to [Semantic Versioning](http://semver.org/) ## [1.0.0-Alpha] - 2015-08-11 ### Notes -* Inital. +* Initial. diff --git a/project/Physics-Simulator.cbp b/project/Physics-Simulator.cbp index cf8afea..d20d0ed 100644 --- a/project/Physics-Simulator.cbp +++ b/project/Physics-Simulator.cbp @@ -160,6 +160,8 @@ + + diff --git a/src/cannonball.cpp b/src/cannonball.cpp index 48e5fb6..7302aeb 100644 --- a/src/cannonball.cpp +++ b/src/cannonball.cpp @@ -36,8 +36,7 @@ clsCannonball::clsCannonball() { props_.interia = 2 * props_.mass * pow(props_.radius,2) / 5.0; place_ = {0,0}; - dblLOC_.x = (double) place_.x; - dblLOC_.y = (double) place_.y; + dblLOC_ = {0.0,0.0}; vel_ = {0,0}; @@ -84,7 +83,6 @@ void clsCannonball::dragCalcValues(void) { props_.area = (double) (2.0 * M_PI * pow(props_.radius,2)); props_.volume = (double) ((4.0/3.0) * M_PI * pow(props_.radius,3)); props_.mass = props_.density * props_.volume; - props_.interia = 2 * props_.mass * pow(props_.radius,2) / 5.0; if(global::blnDebugMode) { printf("Ball %i mass is %5.5f kg.\n",ballID_,props_.mass);} } /*****************************************************************************/ @@ -98,7 +96,7 @@ void clsCannonball::dragUpdateAcc(void) { ///////////////////////////////////////////////// if (vel_.x != 0.0 && vel_.y != 0.0 && props_.mass != 0.0) { - double flow_velocity = sqrt(pow(vel_.x,2) + pow(vel_.y,2)); + double flow_velocity = math::getVectorLength(vel_); double Re = (global::physics::kDensityAir * props_.radius * 2 * flow_velocity); Re /= global::physics::kAirDynViscosity; double drag_force; @@ -122,10 +120,8 @@ void clsCannonball::dragUpdateAcc(void) { angle += vel_.x < 0.0 ? M_PI : 0.0; // update force values - forces_.x -= drag_force * cos (angle); - forces_.y -= drag_force * sin (angle); - - + dblXY dragforces = {drag_force * cos (angle),drag_force * sin (angle)}; + forces_ = math::vectorSub(forces_,dragforces); // Calculate Buoyancy double force_buoyancy; force_buoyancy = global::physics::kDensityAir * props_.volume * @@ -154,15 +150,9 @@ void clsCannonball::update(double newdeltat) { if (!paused_) { deltat_ = newdeltat; - - acc_.x = forces_.x / props_.mass; - acc_.y = forces_.y / props_.mass; - - vel_.x += acc_.x * deltat_; - vel_.y += acc_.y * deltat_; - - dblLOC_.x += vel_.x * deltat_ /*+ 0.5 * acc_.x * pow(deltat_,2)*/; - dblLOC_.y += vel_.y * deltat_ /*+ 0.5 * acc_.y * pow(deltat_,2)*/; + acc_ = math::vectorDiv(forces_,props_.mass); + vel_ = math::vectorAdd(vel_,math::vectorMul(acc_,deltat_)); + dblLoc_ = math::vectorAdd(dblLoc_,math::vectorMul(vel_,deltat_)); setEdgePosition(); @@ -173,7 +163,7 @@ void clsCannonball::update(double newdeltat) { } double total_v; - total_v = sqrt( pow(vel_.x,2) + pow(vel_.y,2) ); + total_v = math::getVectorLength(vel_); if (total_v < global::physics::kMinVelocity || isnan(total_v) ) { blnstarted_ = false; if (global::blnDebugMode) { @@ -382,11 +372,7 @@ void clsCannonball::doFriction() { } } /*****************************************************************************/ -void clsCannonball::addForce(dblXY newforces) { - - forces_.x += newforces.x; - forces_.y += newforces.y; -} +void clsCannonball::addForce(dblXY newforces) {forces_ = math::vectorAdd(forces_,newforces);} /*****************************************************************************/ void clsCannonball::writeInfo() { ///////////////////////////////////////////////// diff --git a/src/cannonball.h b/src/cannonball.h index a483b6f..1b937ee 100644 --- a/src/cannonball.h +++ b/src/cannonball.h @@ -1,7 +1,7 @@ #ifndef __CANNONBALL_HEADER__ #define __CANNONBALL_HEADER__ /*****************************************************************************/ -#include +#include "vector_math.h" #include #include #include @@ -18,14 +18,6 @@ /// @{ ///////////////////////////////////////////////// /*****************************************************************************/ -/** @struct stcDoubleValues - Holds X and Y values that are related together, the values are doubles - (Used for location, velocity and accelerations) */ -struct stcDoubleValues { - double x; /**< X direction values */ - double y; /**< Y direction values */ -}; - /** @struct stcPhysicsProperties Holds the physical properties of the cannonball. */ struct stcPhysicalProperties { @@ -36,7 +28,6 @@ struct stcPhysicalProperties { and it saves me from having to divide. */ double volume; /**< Volume of the ball in m^3 */ double density; /**< Density of the ball in kg/m^3 see Global::Physics::uBallDensity */ - double interia; /**< Interia of the ball in kg-m^2 */ }; /** @struct stcBox @@ -58,7 +49,6 @@ struct stcColor { Uint8 Blue;/**< Amount of Blue in Color, can vary from 0 to 255 */ }; -typedef struct stcDoubleValues dblXY; typedef struct stcPhysicalProperties PP; typedef struct stcBox BOX; typedef struct stcColor clr; diff --git a/src/core.cpp b/src/core.cpp index 73e7c45..7ebd221 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -170,8 +170,8 @@ void cannonballs::doCollide(uint numA, uint numB) { //Equations used can be found and explained here: //https://en.wikipedia.org/wiki/Elastic_collision - Atotal_v = sqrt( pow(Avel.x,2) + pow(Avel.y,2) ); - Btotal_v = sqrt( pow(Bvel.x,2) + pow(Bvel.y,2) ); + Atotal_v = math::getVectorLength(Avel); + Btotal_v = math::getVectorLength(Bvel); //get the angle for both A and B if (Avel.x != 0.0) { Aangle = atan(Avel.y/Avel.x); } @@ -218,8 +218,8 @@ void cannonballs::doCollide(uint numA, uint numB) { TotalBMomentum.y += Btotal_v * sin(Bangle - ContactAngle) * sin(ContactAngle + (M_PI / 2) ); } else { - TotalAMomentum.x = Aprops.mass * Avel.x + Bprops.mass * Bvel.x; - TotalAMomentum.y = Aprops.mass * Avel.y + Bprops.mass * Bvel.y; + TotalAMomentum = math::vectorAdd(math::vectorMul(Avel,Aprops.mass), + math::vectorMul(Bvel,Bprops.mass)); } //end if Perfect Inelastic or not switch (global::physics::collisionmethod) { @@ -234,10 +234,8 @@ void cannonballs::doCollide(uint numA, uint numB) { //cbrt = cube root Aprops.radius = cbrt( (double) (3.0*Aprops.volume) / (double) (4.0*M_PI) ); Aprops.area = (double) (2.0 * M_PI * pow(Aprops.radius, 2) ); - Aprops.interia = (double) (2*Aprops.mass* pow(Aprops.radius,2.0) /5.0); //Now calculate the new velocity - Avel.x = TotalAMomentum.x / Aprops.mass; - Avel.y = TotalAMomentum.y / Aprops.mass; + Avel = math::vectorDiv(TotalAMomentum,Aprops.mass); //now "kill" cannonball B and update ball A balls[numB].blnstarted_ = false; balls[numA].setPhysicalProps(Aprops); @@ -245,11 +243,11 @@ void cannonballs::doCollide(uint numA, uint numB) { break; case CollideInelastic: //uses the same equations as below but some energy is lost. - TotalAMomentum.x *= (double)global::physics::kCoefficientRestitution; - TotalAMomentum.y *= (double)global::physics::kCoefficientRestitution; - TotalBMomentum.x *= (double)global::physics::kCoefficientRestitution; - TotalBMomentum.y *= (double)global::physics::kCoefficientRestitution; - + + TotalAMomentum = math::vectorMul(TotalAMomentum, + (double)global::physics::kCoefficientRestitution); + TotalBMomentum = math::vectorMul(TotalAMomentum, + (double)global::physics::kCoefficientRestitution); case CollideElastic: //The balls collide and bounce away from each other diff --git a/src/rope.cpp b/src/rope.cpp index 0c0a7f0..9d7011e 100644 --- a/src/rope.cpp +++ b/src/rope.cpp @@ -20,7 +20,7 @@ clsRope::clsRope() { clsRope::~clsRope() { blncheckphysics_ = false; balls_ = {nullptr, nullptr}; - if(global::blnDebugMode) {printf("Rope deconstructor called.\n");} + if(global::blnDebugMode) { printf("Rope deconstructor called.\n"); } } /*****************************************************************************/ void clsRope::update() { @@ -85,9 +85,7 @@ void clsRope::activate() { blncheckphysics_ = true; update_spots(); - length_ = (uint)(sqrt ( pow(spot_.one.x - spot_.two.x,2) + - pow(spot_.one.y - spot_.two.y,2) ) ); - + length_ = (uint)math::getVectorLength(math::vectorSub(spot_.one,spot_.two)); draw(); } /*****************************************************************************/ diff --git a/src/vector_math.cpp b/src/vector_math.cpp new file mode 100644 index 0000000..2620521 --- /dev/null +++ b/src/vector_math.cpp @@ -0,0 +1,92 @@ +/*****************************************************************************/ +#include "vector_math.h" +/*****************************************************************************/ +///////////////////////////////////////////////// +/// @file vector_math.h +/// @brief Holds all of the functions for math with vectors +///////////////////////////////////////////////// +/*****************************************************************************/ +double math::getVectorLength(dblXY v1) { + ///////////////////////////////////////////////// + /// @brief Gets length of a vector + /// + /// @param v1 = vector + /// @return length of vector + /// + ///////////////////////////////////////////////// + + return sqrt(pow(v1.x,2) + pow(v1.y,2)); +} +/*****************************************************************************/ +double math::dotProduct(dblXY v1,dblXY v2) { + ///////////////////////////////////////////////// + /// @brief Gets dot product of two vectors + /// + /// @param v1 = vector 1 + /// @param v2 = vector 2 + /// @return value of dot product + /// + ///////////////////////////////////////////////// + return (v1.x * v2.x) + (v1.y * v2.y); +} +/*****************************************************************************/ +double math::crossProduct(dblXY,dblXY){ + ///////////////////////////////////////////////// + /// @brief Gets cross product of two vectors. Since vectors are only 2D, + /// their cross product will only have a Z component + /// + /// @param v1 = vector 1 + /// @param v2 = vector 2 + /// @return Z-value of cross product + /// + ///////////////////////////////////////////////// + return (v1.x * v2.y) - (v2.x * v1.y); +} +/*****************************************************************************/ +dblXY math::vectorDiv(dblXY v1,double ele){ + return {v1.x / ele,v1.y / ele}; +} +/*****************************************************************************/ +dblXY math::vectorDiv(dblXY v1,dblXY v2){ + v1.x /= v2.x; + v1.y /= v2.y; + return v1; +} +/*****************************************************************************/ +dblXY math::vectorAdd(dblXY v1,double ele){ + v1.x += ele; + v1.y += ele; + return v1; +} +/*****************************************************************************/ +dblXY math::vectorAdd(dblXY v1,dblXY v2){ + v1.x += v2.x; + v1.y += v2.y; + return v1; +} +/*****************************************************************************/ +dblXY math::vectorSub(dblXY v1,double ele){ + v1.x -= ele; + v1.y -= ele; + return v1; +} +/*****************************************************************************/ +dblXY math::vectorSub(dblXY v1,dblXY v2){ + v1.x -= v2.x; + v1.y -= v2.y; + return v1; +} +/*****************************************************************************/ +dblXY math::vectorMul(dblXY v1,double ele){ + v1.x *= ele; + v1.y *= ele; + return v1; +} +/*****************************************************************************/ +dblXY math::vectorMul(dblXY v1,dblXY v2){ + v1.x *= v2.x; + v1.y *= v2.y; + return v1; +} +/*****************************************************************************/ + diff --git a/src/vector_math.h b/src/vector_math.h new file mode 100644 index 0000000..9be6d23 --- /dev/null +++ b/src/vector_math.h @@ -0,0 +1,36 @@ +#ifndef __VECTOR_MATH_HEADER__ +#define __VECTOR_MATH_HEADER__ +/*****************************************************************************/ +#include +#include "global.h" +/*****************************************************************************/ +///////////////////////////////////////////////// +/// @file vector_math.h +/// @brief Header for math functions for vectors +///////////////////////////////////////////////// +/*****************************************************************************/ +/** @struct stcDoubleValues + Holds X and Y values that are related together, the values are doubles + (Used for location, velocity and accelerations) */ +struct stcDoubleValues { + double x; /**< X direction values */ + double y; /**< Y direction values */ +}; + +typedef struct stcDoubleValues dblXY; +/*****************************************************************************/ +namespace math { + double getVectorLength(dblXY); + double dotProduct(dblXY,dblXY); + double crossProduct(dblXY,dblXY); + dblXY vectorDiv(dblXY,double); + dblXY vectorDiv(dblXY,dblXY); + dblXY vectorAdd(dblXY,double); + dblXY vectorAdd(dblXY,dblXY); + dblXY vectorSub(dblXY,double); + dblXY vectorSub(dblXY,dblXY); + dblXY vectorMul(dblXY,double); + dblXY vectorMul(dblXY,dblXY); +} +/*****************************************************************************/ +#endif \ No newline at end of file diff --git a/src/version.h b/src/version.h index 71c824e..4b80379 100644 --- a/src/version.h +++ b/src/version.h @@ -15,16 +15,16 @@ /*****************************************************************************/ //Date Version Types /** The day of the last build of the program, currently not used. */ -#define DEFINED_VER_DATE "27" +#define DEFINED_VER_DATE "21" /** The month of the last build of the program, currently not used. */ #define DEFINED_VER_MONTH "03" /** The year of the last build of the program, currently not used. */ -#define DEFINED_VER_YEAR "2018" +#define DEFINED_VER_YEAR "2019" /** The Ubuntu style of the date of the last build. It is in YY.MM format. */ -#define DEFINED_VER_UBUNTU_VERSION_STYLE "18.03" +#define DEFINED_VER_UBUNTU_VERSION_STYLE "19.03" /*****************************************************************************/ /** The Major number of the version number */ #define DEFINED_VER_MAJOR 1 @@ -33,17 +33,17 @@ #define DEFINED_VER_MINOR 4 /** The Patch number of the version number */ -#define DEFINED_VER_PATCH 0 +#define DEFINED_VER_PATCH 1 /*****************************************************************************/ /** The version number in a format used by Boilerplate.rc, It is in the following format [MAJOR].[MINOR].[PATCH].[BUILDNUMBER] */ -#define DEFINED_VER_RC_FILEVERSION 1,4,0,8 +#define DEFINED_VER_RC_FILEVERSION 1,4,1,0 /** Is the same as DEFINED_VER_RC_FILEVERSION but is a null terminated string */ -#define DEFINED_VER_RC_FILEVERSION_STRING "1, 4, 0, 8\0" +#define DEFINED_VER_RC_FILEVERSION_STRING "1, 4, 1, 0\0" /** A more specific string of the file version */ -#define DEFINED_VER_FULLVERSION_STRING "1.4.0-R\0" +#define DEFINED_VER_FULLVERSION_STRING "1.4.1-beta.1\0" //Software Status /** @@ -55,10 +55,10 @@ Software Status can be the following: | Beta | b | This version will compile and / or run but does not work as expected (or crashes often). | | Alpha | a | This version does not work at all; it usually won't compile at all or crashes more times than it works; best not to use versions in this state. | */ -#define DEFINED_VER_STATUS "Release" +#define DEFINED_VER_STATUS "Beta" /** See the table for DEFINED_VER_STATUS */ -#define DEFINED_VER_STATUS_SHORT "r" +#define DEFINED_VER_STATUS_SHORT "b" /// @} /*****************************************************************************/ #endif //__VERSION_HEADER__ From 4016670cae36a12b305e88a4c5015c118732909c Mon Sep 17 00:00:00 2001 From: GamerMan7799 Date: Thu, 21 Mar 2019 16:37:15 -0400 Subject: [PATCH 2/6] Update to v1.4.1-beta.2 A very few small changes to fix mistakes in last update. --- docs/ChangesLog.md | 2 +- src/cannonball.cpp | 3 +-- src/screen.h | 8 -------- src/vector_math.cpp | 21 ++++++++++++++------- src/vector_math.h | 11 ++++++++++- src/version.h | 6 +++--- 6 files changed, 29 insertions(+), 22 deletions(-) diff --git a/docs/ChangesLog.md b/docs/ChangesLog.md index bafbe8d..bf577bf 100644 --- a/docs/ChangesLog.md +++ b/docs/ChangesLog.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented here. This project adheres to [Semantic Versioning](http://semver.org/) -## [1.4.1-beta.1] - 2019-03-21 +## [1.4.1-beta.2] - Unreleased ### Added * Math function specifically to deal with vector math. diff --git a/src/cannonball.cpp b/src/cannonball.cpp index 7302aeb..ce5ba6b 100644 --- a/src/cannonball.cpp +++ b/src/cannonball.cpp @@ -33,7 +33,6 @@ clsCannonball::clsCannonball() { props_.density = global::physics::kBallDensity; //density of steel in kg/m^3 props_.volume = (double) ((4.0/3.0) * M_PI * pow(props_.radius,3)); props_.mass = props_.density * props_.volume; - props_.interia = 2 * props_.mass * pow(props_.radius,2) / 5.0; place_ = {0,0}; dblLOC_ = {0.0,0.0}; @@ -152,7 +151,7 @@ void clsCannonball::update(double newdeltat) { deltat_ = newdeltat; acc_ = math::vectorDiv(forces_,props_.mass); vel_ = math::vectorAdd(vel_,math::vectorMul(acc_,deltat_)); - dblLoc_ = math::vectorAdd(dblLoc_,math::vectorMul(vel_,deltat_)); + dblLOC_ = math::vectorAdd(dblLOC_,math::vectorMul(vel_,deltat_)); setEdgePosition(); diff --git a/src/screen.h b/src/screen.h index 9633b45..336a5ea 100644 --- a/src/screen.h +++ b/src/screen.h @@ -31,15 +31,7 @@ struct stcWinAtt { SDL_Rect toolclips[6]; /**< Clips for the different tools. */ }; /*****************************************************************************/ -/** @struct stcLocation - This structure will hold place values in terms of X and Y*/ -struct stcLocation { - int x; /**< X location */ - int y; /**< Y location */ -}; - typedef struct stcWinAtt WINATT; -typedef struct stcLocation LOC; /// @} /*****************************************************************************/ // It is likely bad practice to hold values like this... diff --git a/src/vector_math.cpp b/src/vector_math.cpp index 2620521..54353d4 100644 --- a/src/vector_math.cpp +++ b/src/vector_math.cpp @@ -15,7 +15,7 @@ double math::getVectorLength(dblXY v1) { /// ///////////////////////////////////////////////// - return sqrt(pow(v1.x,2) + pow(v1.y,2)); + return sqrt(pow(v1.x,2) + pow(v1.y,2)); } /*****************************************************************************/ double math::dotProduct(dblXY v1,dblXY v2) { @@ -26,21 +26,21 @@ double math::dotProduct(dblXY v1,dblXY v2) { /// @param v2 = vector 2 /// @return value of dot product /// - ///////////////////////////////////////////////// - return (v1.x * v2.x) + (v1.y * v2.y); + ///////////////////////////////////////////////// + return (v1.x * v2.x) + (v1.y * v2.y); } /*****************************************************************************/ -double math::crossProduct(dblXY,dblXY){ +double math::crossProduct(dblXY v1,dblXY v2){ ///////////////////////////////////////////////// - /// @brief Gets cross product of two vectors. Since vectors are only 2D, + /// @brief Gets cross product of two vectors. Since vectors are only 2D, /// their cross product will only have a Z component /// /// @param v1 = vector 1 /// @param v2 = vector 2 /// @return Z-value of cross product /// - ///////////////////////////////////////////////// - return (v1.x * v2.y) - (v2.x * v1.y); + ///////////////////////////////////////////////// + return (v1.x * v2.y) - (v2.x * v1.y); } /*****************************************************************************/ dblXY math::vectorDiv(dblXY v1,double ele){ @@ -77,6 +77,13 @@ dblXY math::vectorSub(dblXY v1,dblXY v2){ return v1; } /*****************************************************************************/ +dblXY math::vectorSub(LOC v1,LOC v2){ + dblXY temp; + temp.x = (double) (v1.x - v2.x); + temp.y = (double) (v1.y - v2.y); + return temp; +} +/*****************************************************************************/ dblXY math::vectorMul(dblXY v1,double ele){ v1.x *= ele; v1.y *= ele; diff --git a/src/vector_math.h b/src/vector_math.h index 9be6d23..ee50910 100644 --- a/src/vector_math.h +++ b/src/vector_math.h @@ -17,7 +17,15 @@ struct stcDoubleValues { double y; /**< Y direction values */ }; +/** @struct stcLocation + This structure will hold place values in terms of X and Y*/ +struct stcLocation { + int x; /**< X location */ + int y; /**< Y location */ +}; + typedef struct stcDoubleValues dblXY; +typedef struct stcLocation LOC; /*****************************************************************************/ namespace math { double getVectorLength(dblXY); @@ -29,8 +37,9 @@ namespace math { dblXY vectorAdd(dblXY,dblXY); dblXY vectorSub(dblXY,double); dblXY vectorSub(dblXY,dblXY); + dblXY vectorSub(LOC,LOC); dblXY vectorMul(dblXY,double); dblXY vectorMul(dblXY,dblXY); } /*****************************************************************************/ -#endif \ No newline at end of file +#endif diff --git a/src/version.h b/src/version.h index 4b80379..d1d5b5a 100644 --- a/src/version.h +++ b/src/version.h @@ -37,13 +37,13 @@ /*****************************************************************************/ /** The version number in a format used by Boilerplate.rc, It is in the following format [MAJOR].[MINOR].[PATCH].[BUILDNUMBER] */ -#define DEFINED_VER_RC_FILEVERSION 1,4,1,0 +#define DEFINED_VER_RC_FILEVERSION 1,4,1,2 /** Is the same as DEFINED_VER_RC_FILEVERSION but is a null terminated string */ -#define DEFINED_VER_RC_FILEVERSION_STRING "1, 4, 1, 0\0" +#define DEFINED_VER_RC_FILEVERSION_STRING "1, 4, 1, 2\0" /** A more specific string of the file version */ -#define DEFINED_VER_FULLVERSION_STRING "1.4.1-beta.1\0" +#define DEFINED_VER_FULLVERSION_STRING "1.4.1-beta.2\0" //Software Status /** From 3d11f042a9d52f76de6fd7cb9f61023d6ffaa921 Mon Sep 17 00:00:00 2001 From: GamerMan7799 Date: Thu, 28 May 2020 15:14:41 -0400 Subject: [PATCH 3/6] Update to v1.4.1-beta.3 ## [1.4.1-beta.3] - Unreleased ### Added * Math function specifically to deal with vector math. ### Fixed * Spelling mistakes * Various Code mistakes * Drag tool not un-pausing correctly ### Changed * Updated Doxygen file * Info tool now displays if ball is paused --- docs/ChangesLog.md | 8 +- project/Physics-Simulator.cbp | 5 +- project/doxygen/Doxyfile | 304 +++++++++++++++++++++------------- src/cannonball.cpp | 9 +- src/cannonball.h | 1 + src/core.cpp | 41 +++-- src/main.cpp | 8 +- src/rope.cpp | 4 +- src/vector_math.h | 1 + src/version.h | 14 +- 10 files changed, 243 insertions(+), 152 deletions(-) diff --git a/docs/ChangesLog.md b/docs/ChangesLog.md index bf577bf..14de9ed 100644 --- a/docs/ChangesLog.md +++ b/docs/ChangesLog.md @@ -3,12 +3,18 @@ All notable changes to this project will be documented here. This project adheres to [Semantic Versioning](http://semver.org/) -## [1.4.1-beta.2] - Unreleased +## [1.4.1-beta.3] - Unreleased ### Added * Math function specifically to deal with vector math. ### Fixed * Spelling mistakes +* Various Code mistakes +* Drag tool not un-pausing correctly + +### Changed +* Updated Doxygen file +* Info tool now displays if ball is paused ## [1.4.0-R] - 2018-03-27 ### Added diff --git a/project/Physics-Simulator.cbp b/project/Physics-Simulator.cbp index d20d0ed..5167bd7 100644 --- a/project/Physics-Simulator.cbp +++ b/project/Physics-Simulator.cbp @@ -164,10 +164,6 @@ - - - - @@ -177,6 +173,7 @@ + diff --git a/project/doxygen/Doxyfile b/project/doxygen/Doxyfile index 3b47159..08ce3ae 100644 --- a/project/doxygen/Doxyfile +++ b/project/doxygen/Doxyfile @@ -1,4 +1,4 @@ -# Doxyfile 1.8.13 +# Doxyfile 1.8.15 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project. @@ -17,11 +17,11 @@ # Project related configuration options #--------------------------------------------------------------------------- -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv -# for the list of possible encodings. +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. # The default value is: UTF-8. DOXYFILE_ENCODING = UTF-8 @@ -38,7 +38,7 @@ PROJECT_NAME = Physics-Collision-Simulator # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = v1.4.0 +PROJECT_NUMBER = v1.4.1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -51,7 +51,7 @@ PROJECT_BRIEF = "Simulation of balls hitting each other" # pixels and the maximum width should not exceed 200 pixels. Doxygen will copy # the logo to the output directory. -PROJECT_LOGO = C:/Users/Patrick/Documents/GitHub/SDL-Cannon-Simulation/res/logo.bmp +PROJECT_LOGO = ../../res/logo.bmp # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path # into which the generated documentation will be written. If a relative path is @@ -93,6 +93,14 @@ ALLOW_UNICODE_NAMES = NO OUTPUT_LANGUAGE = English +# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all generated output in the proper direction. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. + +OUTPUT_TEXT_DIRECTION = None + # If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member # descriptions after the members that are listed in the file and class # documentation (similar to Javadoc). Set to NO to disable this. @@ -118,7 +126,7 @@ REPEAT_BRIEF = YES # the entity):The $name class, The $name widget, The $name file, is, provides, # specifies, contains, represents, a, an and the. -ABBREVIATE_BRIEF = +ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # doxygen will generate a detailed section even if there is only a brief @@ -152,7 +160,7 @@ FULL_PATH_NAMES = NO # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = +STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -161,7 +169,7 @@ STRIP_FROM_PATH = # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -226,15 +234,20 @@ TAB_SIZE = 8 # will allow you to put the command \sideeffect (or @sideeffect) in the # documentation, which will result in a user-defined paragraph with heading # "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines. +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. +# When you need a literal { or } or , in the value part of an alias you have to +# escape them by means of a backslash (\), this can lead to conflicts with the +# commands \{ and \} for these it is advised to use the version @{ and @} or use +# a double escape (\\{ and \\}) -ALIASES = +ALIASES = # This tag can be used to specify a number of word-keyword mappings (TCL only). # A mapping has the form "name=value". For example adding "class=itcl::class" # will allow you to use the command class in the itcl::class meaning. -TCL_SUBST = +TCL_SUBST = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources # only. Doxygen will then generate output that is more tailored for C. For @@ -264,28 +277,37 @@ OPTIMIZE_FOR_FORTRAN = NO OPTIMIZE_OUTPUT_VHDL = NO +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + # Doxygen selects the parser to use depending on the extension of the files it # parses. With this tag you can assign which parser to use for a given # extension. Doxygen has a built-in mapping, but you can override or extend it # using this tag. The format is ext=language, where ext is a file extension, and # language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat +# .inc files as Fortran files (default is PHP), and .f files as C (default is +# Fortran), use: inc=Fortran f=C. # # Note: For files without extension you can use no_extension as a placeholder. # # Note that for custom extensions you also need to set FILE_PATTERNS otherwise # the files are not read by doxygen. -EXTENSION_MAPPING = +EXTENSION_MAPPING = # If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments # according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. +# documentation. See https://daringfireball.net/projects/markdown/ for details. # The output of markdown processing is further processed by doxygen, so you can # mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in # case of backward compatibilities issues. @@ -327,7 +349,7 @@ BUILTIN_STL_SUPPORT = NO CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen # will parse them like normal C++ but will assume all classes use public instead # of private inheritance when no explicit protection keyword is present. # The default value is: NO. @@ -638,7 +660,7 @@ GENERATE_DEPRECATEDLIST= YES # sections, marked by \if ... \endif and \cond # ... \endcond blocks. -ENABLED_SECTIONS = +ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the # initial value of a variable or macro / define can have for it to appear in the @@ -680,7 +702,7 @@ SHOW_NAMESPACES = YES # by doxygen. Whatever the program writes to standard output is used as the file # version. For an example see the documentation. -FILE_VERSION_FILTER = +FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated @@ -693,17 +715,17 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib # extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. # For LaTeX the style of the bibliography can be controlled using # LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the # search path. See also \cite for info how to create references. -CITE_BIB_FILES = +CITE_BIB_FILES = #--------------------------------------------------------------------------- # Configuration options related to warning and progress messages @@ -743,7 +765,8 @@ WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that # are documented, but have no documentation for their parameters or return # value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. # The default value is: NO. WARN_NO_PARAMDOC = YES @@ -787,7 +810,7 @@ INPUT = ../../src \ # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses # libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of # possible encodings. # The default value is: UTF-8. @@ -805,9 +828,9 @@ INPUT_ENCODING = UTF-8 # *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, # *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, # *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, -# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. +# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice. -FILE_PATTERNS = +FILE_PATTERNS = # The RECURSIVE tag can be used to specify whether or not subdirectories should # be searched for input files as well. @@ -822,7 +845,7 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = +EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -849,20 +872,20 @@ EXCLUDE_PATTERNS = *.log # Note that the wildcards are matched against the file with absolute path, so to # exclude all test directories use the pattern */test/* -EXCLUDE_SYMBOLS = +EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or directories # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = +EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and # *.h) to filter out the source-files in the directories. If left blank all # files are included. -EXAMPLE_PATTERNS = +EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude commands @@ -896,7 +919,7 @@ IMAGE_PATH = ../Equations.PNG # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -INPUT_FILTER = +INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the @@ -909,7 +932,7 @@ INPUT_FILTER = # need to set EXTENSION_MAPPING for the extension otherwise the files are not # properly processed by doxygen. -FILTER_PATTERNS = +FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will also be used to filter the input files that are used for @@ -924,7 +947,7 @@ FILTER_SOURCE_FILES = NO # *.ext= (so without naming a filter). # This tag requires that the tag FILTER_SOURCE_FILES is set to YES. -FILTER_SOURCE_PATTERNS = +FILTER_SOURCE_PATTERNS = # If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that # is part of the input, its contents will be placed on the main page @@ -960,7 +983,7 @@ INLINE_SOURCES = NO STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. +# entity all documented functions referencing it will be listed. # The default value is: NO. REFERENCED_BY_RELATION = NO @@ -992,12 +1015,12 @@ SOURCE_TOOLTIPS = YES # If the USE_HTAGS tag is set to YES then the references to source code will # point to the HTML generated by the htags(1) tool instead of doxygen built-in # source browser. The htags tool is part of GNU's global source tagging system -# (see http://www.gnu.org/software/global/global.html). You will need version +# (see https://www.gnu.org/software/global/global.html). You will need version # 4.8.6 or higher. # # To use it do the following: # - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file # - Make sure the INPUT points to the root of the source tree # - Run doxygen as normal # @@ -1025,7 +1048,7 @@ VERBATIM_HEADERS = YES # rich C++ code for which doxygen's built-in parser lacks the necessary type # information. # Note: The availability of this option depends on whether or not doxygen was -# generated with the -Duse-libclang=ON option for CMake. +# generated with the -Duse_libclang=ON option for CMake. # The default value is: NO. CLANG_ASSISTED_PARSING = NO @@ -1036,7 +1059,17 @@ CLANG_ASSISTED_PARSING = NO # specified with INPUT and INCLUDE_PATH. # This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. -CLANG_OPTIONS = +CLANG_OPTIONS = + +# If clang assisted parsing is enabled you can provide the clang parser with the +# path to the compilation database (see: +# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files +# were built. This is equivalent to specifying the "-p" option to a clang tool, +# such as clang-check. These options will then be passed to the parser. +# Note: The availability of this option depends on whether or not doxygen was +# generated with the -Duse_libclang=ON option for CMake. + +CLANG_DATABASE_PATH = #--------------------------------------------------------------------------- # Configuration options related to the alphabetical class index @@ -1107,7 +1140,7 @@ HTML_FILE_EXTENSION = .html # of the possible markers and block names see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_HEADER = +HTML_HEADER = # The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each # generated HTML page. If the tag is left blank doxygen will generate a standard @@ -1117,7 +1150,7 @@ HTML_HEADER = # that doxygen normally uses. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_FOOTER = +HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading style # sheet that is used by each HTML page. It can be used to fine-tune the look of @@ -1129,7 +1162,7 @@ HTML_FOOTER = # obsolete. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_STYLESHEET = +HTML_STYLESHEET = # The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined # cascading style sheets that are included after the standard style sheets @@ -1142,7 +1175,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note @@ -1152,12 +1185,12 @@ HTML_EXTRA_STYLESHEET = # files will be copied as-is; there are no commands or markers available. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_FILES = +HTML_EXTRA_FILES = # The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen # will adjust the colors in the style sheet and background images according to # this color. Hue is specified as an angle on a colorwheel, see -# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value # 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 # purple, and 360 is red again. # Minimum value: 0, maximum value: 359, default value: 220. @@ -1193,6 +1226,17 @@ HTML_COLORSTYLE_GAMMA = 60 HTML_TIMESTAMP = YES +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via Javascript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have Javascript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. @@ -1216,13 +1260,13 @@ HTML_INDEX_NUM_ENTRIES = 100 # If the GENERATE_DOCSET tag is set to YES, additional index files will be # generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: http://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# environment (see: https://developer.apple.com/xcode/), introduced with OSX +# 10.5 (Leopard). To create a documentation set, doxygen will generate a # Makefile in the HTML output directory. Running make will produce the docset in # that directory and running make install will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. # The default value is: NO. # This tag requires that the tag GENERATE_HTML is set to YES. @@ -1261,7 +1305,7 @@ DOCSET_PUBLISHER_NAME = Publisher # If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three # additional HTML index files: index.hhp, index.hhc, and index.hhk. The # index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on # Windows. # # The HTML Help Workshop contains a compiler that can convert all HTML output @@ -1289,7 +1333,7 @@ CHM_FILE = ../SDL-Cannon-Simulation.chm # The file has to be specified with full path. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -HHC_LOCATION = +HHC_LOCATION = # The GENERATE_CHI flag controls if a separate .chi index file is generated # (YES) or that it should be included in the master .chm file (NO). @@ -1302,7 +1346,7 @@ GENERATE_CHI = NO # and project file content. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -CHM_INDEX_ENCODING = +CHM_INDEX_ENCODING = # The BINARY_TOC flag controls whether a binary table of contents is generated # (YES) or a normal table of contents (NO) in the .chm file. Furthermore it @@ -1333,11 +1377,11 @@ GENERATE_QHP = NO # the HTML output folder. # This tag requires that the tag GENERATE_QHP is set to YES. -QCH_FILE = +QCH_FILE = # The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help # Project output. For more information please see Qt Help Project / Namespace -# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1345,7 +1389,7 @@ QHP_NAMESPACE = org.doxygen.Project # The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt # Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# Folders (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- # folders). # The default value is: doc. # This tag requires that the tag GENERATE_QHP is set to YES. @@ -1354,33 +1398,33 @@ QHP_VIRTUAL_FOLDER = doc # If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom # filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_NAME = +QHP_CUST_FILTER_NAME = # The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the # custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- # filters). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_CUST_FILTER_ATTRS = +QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this # project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# http://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). # This tag requires that the tag GENERATE_QHP is set to YES. -QHP_SECT_FILTER_ATTRS = +QHP_SECT_FILTER_ATTRS = # The QHG_LOCATION tag can be used to specify the location of Qt's # qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the # generated .qhp file. # This tag requires that the tag GENERATE_QHP is set to YES. -QHG_LOCATION = +QHG_LOCATION = # If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be # generated, together with the HTML files, they form an Eclipse help plugin. To @@ -1463,7 +1507,7 @@ EXT_LINKS_IN_WINDOW = NO FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images # generated for formulas are transparent PNGs. Transparent PNGs are not # supported properly for IE 6.0, but are supported on all modern browsers. # @@ -1475,7 +1519,7 @@ FORMULA_FONTSIZE = 10 FORMULA_TRANSPARENT = YES # Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# http://www.mathjax.org) which uses client side Javascript for the rendering +# https://www.mathjax.org) which uses client side Javascript for the rendering # instead of using pre-rendered bitmaps. Use this if you do not have LaTeX # installed or if you want to formulas look prettier in the HTML output. When # enabled you may also need to install MathJax separately and configure the path @@ -1502,8 +1546,8 @@ MATHJAX_FORMAT = HTML-CSS # MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax # Content Delivery Network so you can quickly see the result without installing # MathJax. However, it is strongly recommended to install a local copy of -# MathJax from http://www.mathjax.org before deployment. -# The default value is: http://cdn.mathjax.org/mathjax/latest. +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/. # This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://www.mathjax.org/mathjax @@ -1513,7 +1557,7 @@ MATHJAX_RELPATH = http://www.mathjax.org/mathjax # MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_EXTENSIONS = +MATHJAX_EXTENSIONS = # The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces # of code that will be used on startup of the MathJax code. See the MathJax site @@ -1521,7 +1565,7 @@ MATHJAX_EXTENSIONS = # example see the documentation. # This tag requires that the tag USE_MATHJAX is set to YES. -MATHJAX_CODEFILE = +MATHJAX_CODEFILE = # When the SEARCHENGINE tag is enabled doxygen will generate a search box for # the HTML output. The underlying search engine uses javascript and DHTML and @@ -1564,7 +1608,7 @@ SERVER_BASED_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). +# Xapian (see: https://xapian.org/). # # See the section "External Indexing and Searching" for details. # The default value is: NO. @@ -1577,11 +1621,11 @@ EXTERNAL_SEARCH = NO # # Doxygen ships with an example indexer (doxyindexer) and search engine # (doxysearch.cgi) which are based on the open source search engine library -# Xapian (see: http://xapian.org/). See the section "External Indexing and +# Xapian (see: https://xapian.org/). See the section "External Indexing and # Searching" for details. # This tag requires that the tag SEARCHENGINE is set to YES. -SEARCHENGINE_URL = +SEARCHENGINE_URL = # When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed # search data is written to a file for indexing by an external tool. With the @@ -1597,7 +1641,7 @@ SEARCHDATA_FILE = searchdata.xml # projects and redirect the results back to the right project. # This tag requires that the tag SEARCHENGINE is set to YES. -EXTERNAL_SEARCH_ID = +EXTERNAL_SEARCH_ID = # The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen # projects other than the one defined by this configuration file, but that are @@ -1607,7 +1651,7 @@ EXTERNAL_SEARCH_ID = # EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ... # This tag requires that the tag SEARCHENGINE is set to YES. -EXTRA_SEARCH_MAPPINGS = +EXTRA_SEARCH_MAPPINGS = #--------------------------------------------------------------------------- # Configuration options related to the LaTeX output @@ -1629,21 +1673,34 @@ LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. # -# Note that when enabling USE_PDFLATEX this option is only used for generating -# bitmaps for formulas in the HTML output, but not in the Makefile that is -# written to the output directory. -# The default file is: latex. +# Note that when not enabling USE_PDFLATEX the default is latex when enabling +# USE_PDFLATEX the default is pdflatex and when in the later case latex is +# chosen this is overwritten by pdflatex. For specific output languages the +# default can have been set differently, this depends on the implementation of +# the output language. # This tag requires that the tag GENERATE_LATEX is set to YES. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate # index for LaTeX. +# Note: This tag is used in the Makefile / make.bat. +# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file +# (.tex). # The default file is: makeindex. # This tag requires that the tag GENERATE_LATEX is set to YES. MAKEINDEX_CMD_NAME = makeindex +# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to +# generate index for LaTeX. +# Note: This tag is used in the generated output file (.tex). +# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat. +# The default value is: \makeindex. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_MAKEINDEX_CMD = \makeindex + # If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX # documents. This may be useful for small projects and may help to save some # trees in general. @@ -1671,7 +1728,7 @@ PAPER_TYPE = a4 # If left blank no extra packages will be included. # This tag requires that the tag GENERATE_LATEX is set to YES. -EXTRA_PACKAGES = +EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for the # generated LaTeX document. The header should contain everything until the first @@ -1687,7 +1744,7 @@ EXTRA_PACKAGES = # to HTML_HEADER. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_HEADER = +LATEX_HEADER = # The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the # generated LaTeX document. The footer should contain everything after the last @@ -1698,7 +1755,7 @@ LATEX_HEADER = # Note: Only use a user-defined footer if you know what you are doing! # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_FOOTER = +LATEX_FOOTER = # The LATEX_EXTRA_STYLESHEET tag can be used to specify additional user-defined # LaTeX style sheets that are included after the standard style sheets created @@ -1709,7 +1766,7 @@ LATEX_FOOTER = # list). # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_STYLESHEET = +LATEX_EXTRA_STYLESHEET = # The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the LATEX_OUTPUT output @@ -1717,7 +1774,7 @@ LATEX_EXTRA_STYLESHEET = # markers available. # This tag requires that the tag GENERATE_LATEX is set to YES. -LATEX_EXTRA_FILES = +LATEX_EXTRA_FILES = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is # prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will @@ -1764,7 +1821,7 @@ LATEX_SOURCE_CODE = NO # The LATEX_BIB_STYLE tag can be used to specify the style to use for the # bibliography, e.g. plainnat, or ieeetr. See -# http://en.wikipedia.org/wiki/BibTeX and \cite for more info. +# https://en.wikipedia.org/wiki/BibTeX and \cite for more info. # The default value is: plain. # This tag requires that the tag GENERATE_LATEX is set to YES. @@ -1778,6 +1835,14 @@ LATEX_BIB_STYLE = plain LATEX_TIMESTAMP = NO +# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute) +# path from which the emoji images will be read. If a relative path is entered, +# it will be relative to the LATEX_OUTPUT directory. If left blank the +# LATEX_OUTPUT directory will be used. +# This tag requires that the tag GENERATE_LATEX is set to YES. + +LATEX_EMOJI_DIRECTORY = + #--------------------------------------------------------------------------- # Configuration options related to the RTF output #--------------------------------------------------------------------------- @@ -1817,22 +1882,22 @@ COMPACT_RTF = NO RTF_HYPERLINKS = NO -# Load stylesheet definitions from file. Syntax is similar to doxygen's config -# file, i.e. a series of assignments. You only have to provide replacements, -# missing definitions are set to their default value. +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# configuration file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. # # See also section "Doxygen usage" for information on how to generate the # default style sheet that doxygen normally uses. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_STYLESHEET_FILE = +RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an RTF document. Syntax is -# similar to doxygen's config file. A template extensions file can be generated -# using doxygen -e rtf extensionFile. +# similar to doxygen's configuration file. A template extensions file can be +# generated using doxygen -e rtf extensionFile. # This tag requires that the tag GENERATE_RTF is set to YES. -RTF_EXTENSIONS_FILE = +RTF_EXTENSIONS_FILE = # If the RTF_SOURCE_CODE tag is set to YES then doxygen will include source code # with syntax highlighting in the RTF output. @@ -1877,7 +1942,7 @@ MAN_EXTENSION = .3 # MAN_EXTENSION with the initial . removed. # This tag requires that the tag GENERATE_MAN is set to YES. -MAN_SUBDIR = +MAN_SUBDIR = # If the MAN_LINKS tag is set to YES and doxygen generates man output, then it # will generate one additional man file for each entity documented in the real @@ -1915,6 +1980,13 @@ XML_OUTPUT = xml XML_PROGRAMLISTING = YES +# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include +# namespace members in file scope as well, matching the HTML output. +# The default value is: NO. +# This tag requires that the tag GENERATE_XML is set to YES. + +XML_NS_MEMB_FILE_SCOPE = NO + #--------------------------------------------------------------------------- # Configuration options related to the DOCBOOK output #--------------------------------------------------------------------------- @@ -1947,9 +2019,9 @@ DOCBOOK_PROGRAMLISTING = NO #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an -# AutoGen Definitions (see http://autogen.sf.net) file that captures the -# structure of the code including all documentation. Note that this feature is -# still experimental and incomplete at the moment. +# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures +# the structure of the code including all documentation. Note that this feature +# is still experimental and incomplete at the moment. # The default value is: NO. GENERATE_AUTOGEN_DEF = NO @@ -1990,7 +2062,7 @@ PERLMOD_PRETTY = YES # overwrite each other's variables. # This tag requires that the tag GENERATE_PERLMOD is set to YES. -PERLMOD_MAKEVAR_PREFIX = +PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor @@ -2031,7 +2103,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2039,7 +2111,7 @@ INCLUDE_PATH = # used. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -INCLUDE_FILE_PATTERNS = +INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that are # defined before the preprocessor is started (similar to the -D option of e.g. @@ -2059,7 +2131,7 @@ PREDEFINED = WXUNUSED()= \ # definition found in the source code. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -EXPAND_AS_DEFINED = +EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will # remove all references to function-like macros that are alone on a line, have @@ -2088,13 +2160,13 @@ SKIP_FUNCTION_MACROS = YES # the path). If a tag file is not located in the directory in which doxygen is # run, you must also specify the path to the tagfile here. -TAGFILES = +TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create a # tag file that is based on the input files it reads. See section "Linking to # external documentation" for more information about the usage of tag files. -GENERATE_TAGFILE = +GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES, all external class will be listed in # the class index. If set to NO, only the inherited external classes will be @@ -2134,7 +2206,7 @@ PERL_PATH = /usr/bin/perl # powerful graphs. # The default value is: YES. -CLASS_DIAGRAMS = NO +CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see: @@ -2143,14 +2215,14 @@ CLASS_DIAGRAMS = NO # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. -MSCGEN_PATH = +MSCGEN_PATH = # You can include diagrams made with dia in doxygen documentation. Doxygen will # then run dia to produce the diagram and insert it in the documentation. The # DIA_PATH tag allows you to specify the directory where the dia binary resides. # If left empty dia is assumed to be found in the default search path. -DIA_PATH = +DIA_PATH = # If set to YES the inheritance and collaboration graphs will hide inheritance # and usage relations if the target is undocumented or is not a class. @@ -2199,7 +2271,7 @@ DOT_FONTSIZE = 10 # the path where dot can find it using this tag. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_FONTPATH = +DOT_FONTPATH = # If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for # each documented class showing the direct and indirect inheritance relations. @@ -2343,26 +2415,26 @@ INTERACTIVE_SVG = NO # found. If left blank, it is assumed the dot tool can be found in the path. # This tag requires that the tag HAVE_DOT is set to YES. -DOT_PATH = "../../../../../../../Program Files (x86)/Graphviz2.38/bin" +DOT_PATH = "C:/Program Files (x86)/Graphviz2.38/bin" # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the \dotfile # command). # This tag requires that the tag HAVE_DOT is set to YES. -DOTFILE_DIRS = +DOTFILE_DIRS = # The MSCFILE_DIRS tag can be used to specify one or more directories that # contain msc files that are included in the documentation (see the \mscfile # command). -MSCFILE_DIRS = +MSCFILE_DIRS = # The DIAFILE_DIRS tag can be used to specify one or more directories that # contain dia files that are included in the documentation (see the \diafile # command). -DIAFILE_DIRS = +DIAFILE_DIRS = # When using plantuml, the PLANTUML_JAR_PATH tag should be used to specify the # path where java can find the plantuml.jar file. If left blank, it is assumed @@ -2370,17 +2442,17 @@ DIAFILE_DIRS = # generate a warning when it encounters a \startuml command in this case and # will not generate output for the diagram. -PLANTUML_JAR_PATH = +PLANTUML_JAR_PATH = # When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a # configuration file for plantuml. -PLANTUML_CFG_FILE = +PLANTUML_CFG_FILE = # When using plantuml, the specified paths are searched for files specified by # the !include statement in a plantuml block. -PLANTUML_INCLUDE_PATH = +PLANTUML_INCLUDE_PATH = # The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes # that will be shown in the graph. If the number of nodes in a graph becomes diff --git a/src/cannonball.cpp b/src/cannonball.cpp index ce5ba6b..2719f8b 100644 --- a/src/cannonball.cpp +++ b/src/cannonball.cpp @@ -163,10 +163,10 @@ void clsCannonball::update(double newdeltat) { double total_v; total_v = math::getVectorLength(vel_); - if (total_v < global::physics::kMinVelocity || isnan(total_v) ) { + if (total_v < global::physics::kMinVelocity || std::isnan(total_v) ) { blnstarted_ = false; if (global::blnDebugMode) { - if ( isnan(total_v) ) { printf("Ball velocity is NaN; killing it.\n"); } + if ( std::isnan(total_v) ) { printf("Ball velocity is NaN; killing it.\n"); } else { printf("Ball moving too slow; killing it.\n"); } } //end if debug mode } //end if should kill @@ -385,6 +385,11 @@ void clsCannonball::writeInfo() { printf("Velocity: \t \t (%5.5f, %5.5f)\n",vel_.x,vel_.y); printf("Acceleration: \t \t (%5.5f, %5.5f)\n",acc_.x,acc_.y); printf("Forces: \t \t (%5.5f, %5.5f)\n", forces_.x, forces_.y); + if (paused_) { + printf("Ball is paused.\n"); + } else { + printf("Ball is not paused.\n"); + } } /*****************************************************************************/ diff --git a/src/cannonball.h b/src/cannonball.h index 1b937ee..d3ae6ba 100644 --- a/src/cannonball.h +++ b/src/cannonball.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "screen.h" /*****************************************************************************/ ///////////////////////////////////////////////// diff --git a/src/core.cpp b/src/core.cpp index 7ebd221..ef6655c 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -57,7 +57,7 @@ void cannonballs::addNew(LOC mouseC, LOC mouseO, double HoldTime ) { mouseO.y = global::config.values.uintScreenHeight - mouseO.y; intCannonBallNum++; clsCannonball tempBall; - tempBall.setValues(radius, mouseO,fire_v, angle, intCannonBallNum); + tempBall.setValues(radius, mouseO, fire_v, angle, intCannonBallNum); if (intCannonBallNum > 1) { if(balls[0].isPaused()) { tempBall.togglePause(); } } @@ -85,8 +85,9 @@ void cannonballs::checkCollisons(uint j) { B = balls[i].getBOX(); if ( checkOverlap(A, B) ) { doCollide(j, i); - /* ball_b_loc = balls[i].getdbLOC(); - do { + ball_b_loc = balls[i].getdbLOC(); + /** @todo (GamerMan7799#9#): This might work for stopping the balls from overlapping, just need to add a check on which way they are colliding */ + /*do { ball_b_loc.x++; ball_b_loc.y++; balls[i].setdbLOC(ball_b_loc); @@ -243,7 +244,7 @@ void cannonballs::doCollide(uint numA, uint numB) { break; case CollideInelastic: //uses the same equations as below but some energy is lost. - + TotalAMomentum = math::vectorMul(TotalAMomentum, (double)global::physics::kCoefficientRestitution); TotalBMomentum = math::vectorMul(TotalAMomentum, @@ -329,6 +330,7 @@ void core::fireRandom() { LOC mouseo, mousec; // time delay can be anywhere from 0.25 to 10 seconds double time_delay = ((rand() % (10000-250) + 250) / 1000); + if (time_delay <= 0.25) { time_delay = 0.25; } mouseo.x = rand() % cnfg.uintScreenWidth; mouseo.y = rand() % cnfg.uintScreenHeight; @@ -361,8 +363,8 @@ char core::handleEvent(SDL_Event* e ) { if ( e->type == SDL_QUIT ) { return 'q'; } if ( e->type == SDL_MOUSEBUTTONDOWN || e->type == SDL_MOUSEBUTTONUP ) { - if (e->type == SDL_MOUSEBUTTONDOWN) {holding = true;} - else if (e->type == SDL_MOUSEBUTTONUP) {holding = false;} + if (e->type == SDL_MOUSEBUTTONDOWN) { holding = true; } + else if (e->type == SDL_MOUSEBUTTONUP) { holding = false; } // there is a mouse-based event, so now we have to check what tool we are using. //if (global::blnDebugMode) { printf("Mouse event found.\n"); } switch ( toolbar.getTool() ) { @@ -500,7 +502,7 @@ void core::doDeleTool(SDL_Event* e) { if( e->type == SDL_MOUSEBUTTONDOWN ){ SDL_GetMouseState(¤tmouse.x, ¤tmouse.y); ball_num = findSelectedBall(currentmouse); - if (ball_num == -1) {return;} + if (ball_num == -1) { return; } cannonballs::balls[ball_num].blnstarted_ = false; } } @@ -534,7 +536,7 @@ void core::doDragTool(SDL_Event* e) { if (e->type == SDL_MOUSEBUTTONDOWN) { ball_num = findSelectedBall(currentmouse); } //else if (e->type == SDL_MOUSEBUTTONUP) { ball_num = -1; } - if (ball_num == -1) {return;} + if (ball_num == -1) { return; } if (e->type == SDL_MOUSEMOTION && holding) { currentmouse.y = global::config.values.uintScreenHeight - currentmouse.y; @@ -544,14 +546,21 @@ void core::doDragTool(SDL_Event* e) { //if(global::blnDebugMode) { printf("Tool Drag event\n"); } if ( holding && !(cannonballs::balls[ball_num].isPaused()) ) { cannonballs::balls[ball_num].togglePause(); - } else if (!(holding) && cannonballs::balls[ball_num].isPaused() - && !(cannonballs::balls.back().isPaused()) && - !(cannonballs::balls.front().isPaused())) { - // will only unpause the dragged ball if the other balls are also - // unpaused. I check the first and last balls to avoid the chance - // that the selected ball is the first or last. - cannonballs::balls[ball_num].togglePause(); - ball_num = -1; + } else if ( !(holding) ) { + // check if the ball is the first or last + if (&cannonballs::balls[ball_num] == &cannonballs::balls.front()) { + if (!(cannonballs::balls.back().isPaused()) && + cannonballs::balls[ball_num].isPaused()) { + cannonballs::balls[ball_num].togglePause(); + ball_num = -1; + } + } else { + if (!(cannonballs::balls.front().isPaused()) && + cannonballs::balls[ball_num].isPaused()) { + cannonballs::balls[ball_num].togglePause(); + ball_num = -1; + } + } } } /*****************************************************************************/ diff --git a/src/main.cpp b/src/main.cpp index 2cb339c..f8e5428 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -171,11 +171,11 @@ int main(int argc, char *argv[]) { } while (!quit); //keep looping until we get a quit // clear vectors is not empty - if(!cannonballs::ropes.empty()) {cannonballs::ropes = VectorRope();} - if(global::blnDebugMode) {printf("Ropes cleared.\n");} + if(!cannonballs::ropes.empty()) { cannonballs::ropes = VectorRope(); } + if(global::blnDebugMode) { printf("Ropes cleared.\n"); } - if(!cannonballs::balls.empty()) {cannonballs::balls = VectorCannon();} - if(global::blnDebugMode) {printf("Balls cleared.\n");} + if(!cannonballs::balls.empty()) { cannonballs::balls = VectorCannon(); } + if(global::blnDebugMode) { printf("Balls cleared.\n"); } return 0; } /*****************************************************************************/ diff --git a/src/rope.cpp b/src/rope.cpp index 9d7011e..093ef44 100644 --- a/src/rope.cpp +++ b/src/rope.cpp @@ -173,7 +173,7 @@ dblXY clsRope::ballWallForces(dblXY ball_one_forces, double angle) { if (angle == M_PI / 2 || angle == 3/2 * M_PI ) { tension.x = 0; tension.y = ball_one_forces.y; - if (!(signbit((double)spot_.one.y-(double)spot_.two.y) ^ signbit(ball_one_forces.y))) { + if (!(std::signbit((double)spot_.one.y-(double)spot_.two.y) ^ std::signbit(ball_one_forces.y))) { // force and direction to spot two are both positive or both negative, therefore // reverse the force for tension tension.y *= -1; @@ -187,7 +187,7 @@ dblXY clsRope::ballWallForces(dblXY ball_one_forces, double angle) { } else { tension.y = 0; tension.x = ball_one_forces.x; - if ((signbit((double)spot_.one.x-(double)spot_.two.x) ^ signbit(ball_one_forces.x))) { + if ((std::signbit((double)spot_.one.x-(double)spot_.two.x) ^ std::signbit(ball_one_forces.x))) { // force and direction to spot two are both positive or both negative, therefore // reverse the force for tension tension.x *= -1; diff --git a/src/vector_math.h b/src/vector_math.h index ee50910..12442fd 100644 --- a/src/vector_math.h +++ b/src/vector_math.h @@ -2,6 +2,7 @@ #define __VECTOR_MATH_HEADER__ /*****************************************************************************/ #include +#include #include "global.h" /*****************************************************************************/ ///////////////////////////////////////////////// diff --git a/src/version.h b/src/version.h index d1d5b5a..9ad7cfe 100644 --- a/src/version.h +++ b/src/version.h @@ -15,16 +15,16 @@ /*****************************************************************************/ //Date Version Types /** The day of the last build of the program, currently not used. */ -#define DEFINED_VER_DATE "21" +#define DEFINED_VER_DATE "28" /** The month of the last build of the program, currently not used. */ -#define DEFINED_VER_MONTH "03" +#define DEFINED_VER_MONTH "05" /** The year of the last build of the program, currently not used. */ -#define DEFINED_VER_YEAR "2019" +#define DEFINED_VER_YEAR "2020" /** The Ubuntu style of the date of the last build. It is in YY.MM format. */ -#define DEFINED_VER_UBUNTU_VERSION_STYLE "19.03" +#define DEFINED_VER_UBUNTU_VERSION_STYLE "20.05" /*****************************************************************************/ /** The Major number of the version number */ #define DEFINED_VER_MAJOR 1 @@ -37,13 +37,13 @@ /*****************************************************************************/ /** The version number in a format used by Boilerplate.rc, It is in the following format [MAJOR].[MINOR].[PATCH].[BUILDNUMBER] */ -#define DEFINED_VER_RC_FILEVERSION 1,4,1,2 +#define DEFINED_VER_RC_FILEVERSION 1,4,1,3 /** Is the same as DEFINED_VER_RC_FILEVERSION but is a null terminated string */ -#define DEFINED_VER_RC_FILEVERSION_STRING "1, 4, 1, 2\0" +#define DEFINED_VER_RC_FILEVERSION_STRING "1, 4, 1, 3\0" /** A more specific string of the file version */ -#define DEFINED_VER_FULLVERSION_STRING "1.4.1-beta.2\0" +#define DEFINED_VER_FULLVERSION_STRING "1.4.1-beta.3\0" //Software Status /** From 57cb92be25584a0f3cf6ad220f9a5f9fd8a12c49 Mon Sep 17 00:00:00 2001 From: GamerMan7799 Date: Fri, 29 May 2020 13:31:05 -0400 Subject: [PATCH 4/6] Update to v1.4.1-rc.1 ## [1.4.1-rc.1] - 2020.05.29 ### Added * Pause symbol for when simulation is paused (Issue #10) ### Fixed * Defined macros not working correctly since I moved certain functions to core.cpp ### Changed * Modified the check overlap function --- docs/ChangesLog.md | 5 +++- src/core.cpp | 71 ++++++++++++++++++++++++++++----------------- src/global.h | 19 +++++++++++- src/image_tools.xpm | 28 ++++++++++++++++-- src/main.cpp | 16 ++-------- src/screen.cpp | 3 ++ src/screen.h | 2 +- src/toolbar.cpp | 8 +++++ src/version.h | 12 ++++---- 9 files changed, 113 insertions(+), 51 deletions(-) diff --git a/docs/ChangesLog.md b/docs/ChangesLog.md index 14de9ed..5294bba 100644 --- a/docs/ChangesLog.md +++ b/docs/ChangesLog.md @@ -3,18 +3,21 @@ All notable changes to this project will be documented here. This project adheres to [Semantic Versioning](http://semver.org/) -## [1.4.1-beta.3] - Unreleased +## [1.4.1-rc.1] - Unreleased ### Added * Math function specifically to deal with vector math. +* Pause symbol for when simulation is paused (Issue #10) ### Fixed * Spelling mistakes * Various Code mistakes * Drag tool not un-pausing correctly +* Defined macros not working correctly since I moved certain functions to core.cpp ### Changed * Updated Doxygen file * Info tool now displays if ball is paused +* Modified the check overlap function ## [1.4.0-R] - 2018-03-27 ### Added diff --git a/src/core.cpp b/src/core.cpp index ef6655c..5b2966a 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -58,9 +58,7 @@ void cannonballs::addNew(LOC mouseC, LOC mouseO, double HoldTime ) { intCannonBallNum++; clsCannonball tempBall; tempBall.setValues(radius, mouseO, fire_v, angle, intCannonBallNum); - if (intCannonBallNum > 1) { - if(balls[0].isPaused()) { tempBall.togglePause(); } - } + if (global::blnPaused) { tempBall.togglePause(); } balls.push_back(tempBall); return; @@ -77,6 +75,7 @@ void cannonballs::checkCollisons(uint j) { ///////////////////////////////////////////////// BOX A, B; + dblXY ball_a_loc; dblXY ball_b_loc; A = balls[j].getBOX(); if (balls[j].blncheckphysics_) { @@ -85,14 +84,31 @@ void cannonballs::checkCollisons(uint j) { B = balls[i].getBOX(); if ( checkOverlap(A, B) ) { doCollide(j, i); - ball_b_loc = balls[i].getdbLOC(); - /** @todo (GamerMan7799#9#): This might work for stopping the balls from overlapping, just need to add a check on which way they are colliding */ - /*do { - ball_b_loc.x++; - ball_b_loc.y++; + /** @todo (GamerMan7799#3#): This might work for stopping the balls from overlapping, just need to add a check on which way they are colliding */ +#if DEFINED_PUSH_BALLS_OUT_OF_OVERLAP == 1 + ball_a_loc = balls[j].getdbLOC(); + ball_b_loc = balls[i].getdbLOC(); + do { + if (A.right <= B.right && A.right >= B.left) { + ball_a_loc.x--; + ball_b_loc.x++; + } else if (A.left >= B.left && A.left <= B.right) { + ball_a_loc.x++; + ball_b_loc.x--; + } + if (A.top >= B.top && A.top <= B.bottom) { + ball_a_loc.y++; + ball_b_loc.y--; + } else if (A.bottom >= B.top && A.bottom <= B.bottom) { + ball_a_loc.y--; + ball_b_loc.y++; + } balls[i].setdbLOC(ball_b_loc); + balls[j].setdbLOC(ball_a_loc); + A = balls[j].getBOX(); B = balls[i].getBOX(); - } while (checkOverlap(A,B)); */ + } while (checkOverlap(A,B)); +#endif balls[i].blncheckphysics_ = false; balls[j].blncheckphysics_ = false; } // end if overlap @@ -111,12 +127,24 @@ bool cannonballs::checkOverlap(BOX A, BOX B) { /// ///////////////////////////////////////////////// - if( A.right < B.left ){ return false; } + /** @todo (GamerMan7799#9#): Improve the overlap check to allow pixel-by-pixel detection */ + + if (A.right <= B.right && A.right >= B.left) { + if (A.top >= B.top && A.top <= B.bottom) { return true; } + else if (A.bottom >= B.top && A.bottom <= B.bottom) { return true; } + else { return false; } + } else if (A.left >= B.left && A.left <= B.right) { + if (A.top >= B.top && A.top <= B.bottom) { return true; } + else if (A.bottom >= B.top && A.bottom <= B.bottom) { return true; } + else { return false; } + } else { return false; } + + /*if( A.right < B.left ){ return false; } if( A.left > B.right ){ return false; } if( A.bottom < B.top ){ return false; } if( A.top > B.bottom ){ return false; } - return true; + return true;*/ } /*****************************************************************************/ void cannonballs::doCollide(uint numA, uint numB) { @@ -408,6 +436,7 @@ char core::handleEvent(SDL_Event* e ) { return 0; case SDLK_p: //"pauses" the simulation by preventing ball from updating + global::blnPaused = !(global::blnPaused); for (int i = 0; i < cannonballs::balls.size(); ++i) { cannonballs::balls[i].togglePause(); } return 0; @@ -544,23 +573,11 @@ void core::doDragTool(SDL_Event* e) { } //if(global::blnDebugMode) { printf("Tool Drag event\n"); } - if ( holding && !(cannonballs::balls[ball_num].isPaused()) ) { + if ( holding && !(cannonballs::balls[ball_num].isPaused()) && !(global::blnPaused) ) { cannonballs::balls[ball_num].togglePause(); - } else if ( !(holding) ) { - // check if the ball is the first or last - if (&cannonballs::balls[ball_num] == &cannonballs::balls.front()) { - if (!(cannonballs::balls.back().isPaused()) && - cannonballs::balls[ball_num].isPaused()) { - cannonballs::balls[ball_num].togglePause(); - ball_num = -1; - } - } else { - if (!(cannonballs::balls.front().isPaused()) && - cannonballs::balls[ball_num].isPaused()) { - cannonballs::balls[ball_num].togglePause(); - ball_num = -1; - } - } + } else if ( !(holding) && !(global::blnPaused) ) { + cannonballs::balls[ball_num].togglePause(); + ball_num = -1; } } /*****************************************************************************/ diff --git a/src/global.h b/src/global.h index 9172af2..0f4ba4f 100644 --- a/src/global.h +++ b/src/global.h @@ -9,6 +9,21 @@ /// Global namespace. See Main.cpp for more details ///////////////////////////////////////////////// /*****************************************************************************/ +#define DEFINED_USE_R2_VEL_MODDER 0 +/**< If this is defined, then program will use unrealistic method that will + increase the velocity of two colliding balls the closer they are together + it will reduce the number of times that the balls stick together, + but also causes them to get unrealistically high velocities. */ +/*****************************************************************************/ +#define DEFINED_COLLISION_NORMAL_FORCE 0 +/**< If this is defined, then program will use apply a normal force to any + colliding balls. The forces are along the same direction as the velocities + are. It doesn't make sense in the real world. */ +/*****************************************************************************/ +#define DEFINED_PUSH_BALLS_OUT_OF_OVERLAP 1 +/**< This will turn on a method that will attempt to move the balls until they + are no longer overlapping when detecting collision. */ +/*****************************************************************************/ class clsConfig; /*****************************************************************************/ //global typedefs @@ -31,6 +46,7 @@ namespace cannonballs { namespace global { extern const bool blnDebugMode; extern clsConfig config; + extern bool blnPaused; namespace physics { ///////////////////////////////////////////////// /// @defgroup ChangeablePhysics Defined Physics values @@ -88,7 +104,8 @@ enum Tools { ToolDrop, /**< Drops a ball without velocity. */ ToolDele, /**< Tool to delete selected ball. */ ToolDrag, /**< Tool that allows ball to be dragged around. */ - ToolInfo /**< Tool that writes information about the selected ball to screen */ + ToolInfo, /**< Tool that writes information about the selected ball to screen */ + ToolPause /**< Not really a tool, but the pause symbol */ }; /*****************************************************************************/ #endif // __GLOBAL_H_INCLUDED__ diff --git a/src/image_tools.xpm b/src/image_tools.xpm index 440d3a6..5e2f7cd 100644 --- a/src/image_tools.xpm +++ b/src/image_tools.xpm @@ -1,6 +1,6 @@ /* XPM */ static char * image_tools_xpm[] = { -"24 144 2 1", +"24 168 2 1", " c None", ". c #FFFFFF", " ", @@ -146,4 +146,28 @@ static char * image_tools_xpm[] = { " ................ ", " ............. ", " .......... ", -" .... "}; +" .... ", +" ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" ........ ........ ", +" "}; diff --git a/src/main.cpp b/src/main.cpp index f8e5428..f972332 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,8 +4,8 @@ /// @brief Holds all the main functions. /// @author GamerMan7799 /// @author xPUREx -/// @version 1.4.0-R -/// @date 2018 +/// @version 1.4.1-rc.1 +/// @date 2015-2020 /// @copyright Public Domain Unlicense. ///////////////////////////////////////////////// /*****************************************************************************/ @@ -16,17 +16,6 @@ /** @todo (GamerMan7799#8#): Allow setting of some Physics Values in Config */ /** @todo (GamerMan7799#8#): Set Max/Min values for mass? */ /*****************************************************************************/ -#define DEFINED_USE_R2_VEL_MODDER 0 -/**< If this is defined, then program will use unrealistic method that will - increase the velocity of two colliding balls the closer they are together - it will reduce the number of times that the balls stick together, - but also causes them to get unrealistically high velocities. */ -/*****************************************************************************/ -#define DEFINED_COLLISION_NORMAL_FORCE 0 -/**< If this is defined, then program will use apply a normal force to any - colliding balls. The forces are along the same direction as the velocities - are. It doesn't make sense in the real world. */ -/*****************************************************************************/ #include "version.h" #include "core.h" /*****************************************************************************/ @@ -40,6 +29,7 @@ namespace global { #endif clsConfig config; + bool blnPaused = false; /** Holds Values that are related the the physics of the world, these are all based on real numbers */ diff --git a/src/screen.cpp b/src/screen.cpp index cca2284..39f76a3 100644 --- a/src/screen.cpp +++ b/src/screen.cpp @@ -330,6 +330,8 @@ void clsScreen::setClips() { * +-----+ * |(0,5)| * +-----+ + * |(0,6)| + * +-----+ */ int pic_size = 24; @@ -340,6 +342,7 @@ void clsScreen::setClips() { screen::screenatt.toolclips[ToolDele] = {0 * pic_size, 3 * pic_size, pic_size, pic_size}; screen::screenatt.toolclips[ToolDrag] = {0 * pic_size, 4 * pic_size, pic_size, pic_size}; screen::screenatt.toolclips[ToolInfo] = {0 * pic_size, 5 * pic_size, pic_size, pic_size}; + screen::screenatt.toolclips[ToolPause] = {0 * pic_size, 6 * pic_size, pic_size, pic_size}; } /*****************************************************************************/ diff --git a/src/screen.h b/src/screen.h index 336a5ea..46342a7 100644 --- a/src/screen.h +++ b/src/screen.h @@ -28,7 +28,7 @@ struct stcWinAtt { SDL_Texture *pixel; /**< The pixel texture, used to draw lines */ SDL_Texture *toolbox; /**< Toolbox frame texture. */ SDL_Texture *tools; /**< Textures for the tools in the toolbox. */ - SDL_Rect toolclips[6]; /**< Clips for the different tools. */ + SDL_Rect toolclips[7]; /**< Clips for the different tools. */ }; /*****************************************************************************/ typedef struct stcWinAtt WINATT; diff --git a/src/toolbar.cpp b/src/toolbar.cpp index ccecea3..ca6a015 100644 --- a/src/toolbar.cpp +++ b/src/toolbar.cpp @@ -22,6 +22,10 @@ void clsToolbar::show() { // Make SDL rect just for the tool picture inside the frame SDL_Rect tool_pic_box = {position_.x+2,position_.y+2,24,24}; + SDL_Rect pause_location = {screen::screenatt.width-24,2,24,24}; + + pause_location.x + 28; + if(show_toolbox_) { // only show if enabled SDL_RenderCopy(screen::screenatt.ren,screen::screenatt.toolbox, @@ -31,6 +35,10 @@ void clsToolbar::show() { SDL_RenderCopy(screen::screenatt.ren,screen::screenatt.tools, &screen::screenatt.toolclips[selected_tool_], &tool_pic_box); + if (global::blnPaused) { + SDL_RenderCopy(screen::screenatt.ren,screen::screenatt.tools, + &screen::screenatt.toolclips[ToolPause], &pause_location); + } } } /*****************************************************************************/ diff --git a/src/version.h b/src/version.h index 9ad7cfe..2cc2728 100644 --- a/src/version.h +++ b/src/version.h @@ -15,7 +15,7 @@ /*****************************************************************************/ //Date Version Types /** The day of the last build of the program, currently not used. */ -#define DEFINED_VER_DATE "28" +#define DEFINED_VER_DATE "29" /** The month of the last build of the program, currently not used. */ #define DEFINED_VER_MONTH "05" @@ -37,13 +37,13 @@ /*****************************************************************************/ /** The version number in a format used by Boilerplate.rc, It is in the following format [MAJOR].[MINOR].[PATCH].[BUILDNUMBER] */ -#define DEFINED_VER_RC_FILEVERSION 1,4,1,3 +#define DEFINED_VER_RC_FILEVERSION 1,4,1,4 /** Is the same as DEFINED_VER_RC_FILEVERSION but is a null terminated string */ -#define DEFINED_VER_RC_FILEVERSION_STRING "1, 4, 1, 3\0" +#define DEFINED_VER_RC_FILEVERSION_STRING "1, 4, 1, 4\0" /** A more specific string of the file version */ -#define DEFINED_VER_FULLVERSION_STRING "1.4.1-beta.3\0" +#define DEFINED_VER_FULLVERSION_STRING "1.4.1-rc.1\0" //Software Status /** @@ -55,10 +55,10 @@ Software Status can be the following: | Beta | b | This version will compile and / or run but does not work as expected (or crashes often). | | Alpha | a | This version does not work at all; it usually won't compile at all or crashes more times than it works; best not to use versions in this state. | */ -#define DEFINED_VER_STATUS "Beta" +#define DEFINED_VER_STATUS "Release Candidate" /** See the table for DEFINED_VER_STATUS */ -#define DEFINED_VER_STATUS_SHORT "b" +#define DEFINED_VER_STATUS_SHORT "rc" /// @} /*****************************************************************************/ #endif //__VERSION_HEADER__ From f9e91b3e759cf097dc6a2da79abe340464c046ff Mon Sep 17 00:00:00 2001 From: GamerMan7799 Date: Fri, 29 May 2020 13:43:06 -0400 Subject: [PATCH 5/6] Update to v1.4.1-R ## [1.4.1-R] - 2020-05-29 ### Added * Math function specifically to deal with vector math. * Pause symbol for when simulation is paused (Issue #10) ### Fixed * Spelling mistakes * Various Code mistakes * Drag tool not un-pausing correctly * Defined macros not working correctly since I moved certain functions to core.cpp ### Changed * Updated Doxygen file * Info tool now displays if ball is paused * Modified the check overlap function --- src/global.h | 2 +- src/main.cpp | 2 +- src/version.h | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/global.h b/src/global.h index 0f4ba4f..56ae77e 100644 --- a/src/global.h +++ b/src/global.h @@ -20,7 +20,7 @@ colliding balls. The forces are along the same direction as the velocities are. It doesn't make sense in the real world. */ /*****************************************************************************/ -#define DEFINED_PUSH_BALLS_OUT_OF_OVERLAP 1 +#define DEFINED_PUSH_BALLS_OUT_OF_OVERLAP 0 /**< This will turn on a method that will attempt to move the balls until they are no longer overlapping when detecting collision. */ /*****************************************************************************/ diff --git a/src/main.cpp b/src/main.cpp index f972332..e45f6f9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -4,7 +4,7 @@ /// @brief Holds all the main functions. /// @author GamerMan7799 /// @author xPUREx -/// @version 1.4.1-rc.1 +/// @version 1.4.1-R /// @date 2015-2020 /// @copyright Public Domain Unlicense. ///////////////////////////////////////////////// diff --git a/src/version.h b/src/version.h index 2cc2728..03c420e 100644 --- a/src/version.h +++ b/src/version.h @@ -37,13 +37,13 @@ /*****************************************************************************/ /** The version number in a format used by Boilerplate.rc, It is in the following format [MAJOR].[MINOR].[PATCH].[BUILDNUMBER] */ -#define DEFINED_VER_RC_FILEVERSION 1,4,1,4 +#define DEFINED_VER_RC_FILEVERSION 1,4,1,5 /** Is the same as DEFINED_VER_RC_FILEVERSION but is a null terminated string */ -#define DEFINED_VER_RC_FILEVERSION_STRING "1, 4, 1, 4\0" +#define DEFINED_VER_RC_FILEVERSION_STRING "1, 4, 1, 5\0" /** A more specific string of the file version */ -#define DEFINED_VER_FULLVERSION_STRING "1.4.1-rc.1\0" +#define DEFINED_VER_FULLVERSION_STRING "1.4.1-R\0" //Software Status /** @@ -55,10 +55,10 @@ Software Status can be the following: | Beta | b | This version will compile and / or run but does not work as expected (or crashes often). | | Alpha | a | This version does not work at all; it usually won't compile at all or crashes more times than it works; best not to use versions in this state. | */ -#define DEFINED_VER_STATUS "Release Candidate" +#define DEFINED_VER_STATUS "Release" /** See the table for DEFINED_VER_STATUS */ -#define DEFINED_VER_STATUS_SHORT "rc" +#define DEFINED_VER_STATUS_SHORT "r" /// @} /*****************************************************************************/ #endif //__VERSION_HEADER__ From 2c0f9e9eb52476bb1ca4ddf20a100878454941c2 Mon Sep 17 00:00:00 2001 From: GamerMan7799 Date: Fri, 29 May 2020 13:43:46 -0400 Subject: [PATCH 6/6] Update to v1.4.1-R part 2 Forgot to save change log update --- docs/ChangesLog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ChangesLog.md b/docs/ChangesLog.md index 5294bba..1db74bc 100644 --- a/docs/ChangesLog.md +++ b/docs/ChangesLog.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented here. This project adheres to [Semantic Versioning](http://semver.org/) -## [1.4.1-rc.1] - Unreleased +## [1.4.1-R] - 2020-05-29 ### Added * Math function specifically to deal with vector math. * Pause symbol for when simulation is paused (Issue #10)