Conversation
- Seperate detection and resolve session - Rearrange inline `pair_hash` struct, so it can be reusable - Create alias for `SpatialGrid` and `CollisionsObject` to reduce complexity - Remove dynamic casting while calculating the `center` of the game objects, now call the `getCenter()` function handle the casting operation.
|
LGTM. Did you test the code and see everything worked perfect? @ecrinyildiz |
|
This PR does not introduce any new features or remove existing ones; it only involves refactoring. That's why the behavior of the code remains unchanged from its previous state. So, I did not conduct additional tests. Any issues that may arise would likely have existed in the prior implementation. |
…aming conventions.
| { | ||
| if(stable) | ||
| { | ||
| m_velocity *= 0; |
There was a problem hiding this comment.
instead of multiplication, you can directly set to zero
if (stable && m_velocity != 0) // Only modify velocity if needed
{
m_velocity = 0;
}
There was a problem hiding this comment.
Vector2D class doesnt have a copy constructor for scalar values, thats why. You would have seen this if you check how the class is implemented in the first place :)
| } | ||
| else | ||
| { | ||
| m_velocity *= 0; |
There was a problem hiding this comment.
why do you choose multiplication instead of directly set?
There was a problem hiding this comment.
I explained on the other comment. Refer to this answer please.
…lides with other.
|
you didnt even care my previous comments, anyway when i checkout the branch it doesnt look like weird to me. but it doesnt look like the infinite bounce problem was fixed when objects collide. |
can you do your explanation more detailed, like what do you mean "it doesnt looks like", what happens when you run the program? Does it keep bouncing and counting up? Does it even plays the collision audio? |
|
i didnt notice the collision sounds, but im sure that i created a scenario where two objects collide and never separate while the collision count to increase infinitely. i dont have a specific steps to reproduce this problem. it happened while i randomly testing |
…ith different compiler flags.
…es the game not launchable since it gets stuck over a corrupted vector loop
- Seperate detection and resolve session - Rearrange inline `pair_hash` struct, so it can be reusable - Create alias for `SpatialGrid` and `CollisionsObject` to reduce complexity - Remove dynamic casting while calculating the `center` of the game objects, now call the `getCenter()` function handle the casting operation.
pair_hashstruct, so it can be reusableSpatialGridandCollisionsObjectto reduce complexitycenterof the game objects, now call thegetCenter()function handle the casting operation.Remark:
Read the issue #51