|
1 | 1 | /*****************************************************************************/ |
2 | 2 | //General Todos |
3 | 3 | /* FIXME (GamerMan7799#1#): The balls will become stuck together for seemingly random reasons */ |
4 | | -/* TODO (GamerMan7799#5#): Collision Method can be set in Config */ |
5 | 4 | /* TODO (GamerMan7799#9#): Allow setting of some Physics Values in Config */ |
6 | 5 | /*****************************************************************************/ |
7 | 6 | #include "version.h" |
@@ -29,17 +28,6 @@ namespace Cannonballs { |
29 | 28 | clsCannonball Balls[DEFINED_CANNONBALL_LIMIT]; /**< The is the array that holds all of the cannonballs. */ |
30 | 29 | } |
31 | 30 | /*****************************************************************************/ |
32 | | -/** The method of the collision (I just wanted to play around with some options.) */ |
33 | | -enum Collisions { |
34 | | - CollideElastic = 0, /**< This is normal collision in a perfect world without |
35 | | - friction, they hit and bounce off, no energy is lost. */ |
36 | | - CollideInelastic, /**< This is the normal way things collide, Balls collide and |
37 | | - bounce off of each other losing some energy. */ |
38 | | - CollidePerfectInelastic, /**< In this method the balls collide and then |
39 | | - stick together. */ |
40 | | - CollideNone /**< No collisions, balls pass through each other. */ |
41 | | -}; |
42 | | -/*****************************************************************************/ |
43 | 31 | namespace Global { |
44 | 32 | /** Holds if build is in debug mode, this can happen if |
45 | 33 | DEFINED_BUILD_MODE_PRIVATE is defined in the complier */ |
@@ -67,7 +55,7 @@ namespace Global { |
67 | 55 | const float fMinVelocity = 0.0; /**< If a ball has less velocity than the it will "die" */ |
68 | 56 | const float fCoefficientRestitution = 0.76; /**< How much total energy remains after a collision, |
69 | 57 | (see https://en.wikipedia.org/wiki/Coefficient_of_restitution for more info) */ |
70 | | - const uchar CollisionMethod = CollideInelastic; /**< The collision method to use (see Collisions Enum) */ |
| 58 | + uchar CollisionMethod = CollideInelastic; /**< The collision method to use (see Collisions Enum) */ |
71 | 59 | } //end Namespace Physics |
72 | 60 |
|
73 | 61 | /** Holds Values for different equations that are not physics related */ |
@@ -275,6 +263,7 @@ void Cannonballs::doCollide(uint numA, uint numB) { |
275 | 263 | ///////////////////////////////////////////////// |
276 | 264 | /// @brief Will calculate the new velocities of two balls that are colliding |
277 | 265 | /// |
| 266 | + /// @image html Equations.PNG "The equations used to get the resulting velocities." |
278 | 267 | /// @param numA = the number in the array ball A is |
279 | 268 | /// @param numB = the number in the array ball B is |
280 | 269 | /// @return void (everything is handled inside the function) |
|
0 commit comments