Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OnCollision are called even after objects involved are moved and not intersecting #795

Merged

Conversation

toore
Copy link
Contributor

@toore toore commented Nov 19, 2022

Resolve #796

Potentially resolve #591

I changed the algorithm, so that the actual bounds are always used. I don't know if this will cause any unwanted side-effects.

A couple of unit tests were added to prove the case.

@toore toore changed the title Collisions are not properly detected because of cached bounds being used OnCollision are still called after objects involved has moved apart from each other Nov 19, 2022
@toore toore changed the title OnCollision are still called after objects involved has moved apart from each other OnCollision are still called after objects involved have moved apart from each other Nov 19, 2022
@toore toore changed the title OnCollision are still called after objects involved have moved apart from each other OnCollision are still called even after objects involved are moved and not intersecting Nov 19, 2022
@toore toore changed the title OnCollision are still called even after objects involved are moved and not intersecting OnCollision are called even after objects involved are moved and not intersecting Nov 19, 2022
@toore toore force-pushed the bug-update-bounds-collision-manager branch from 1346068 to e552f8f Compare November 20, 2022 16:00
@toore toore force-pushed the bug-update-bounds-collision-manager branch from e552f8f to 40a2621 Compare August 6, 2023 17:35
@florentmontesano
Copy link

florentmontesano commented Aug 22, 2023

I had a similar issue as #796 and fixed it by moving the value.Bounds = value.Target.Bounds; statement one line below, to put it out of the loop in CollisionComponent#Update.

Your solution is much better since there is no more need to update the actual bounds.

I tested this fix in my game and it looks good.

Please merge! 👍

@Gandifil
Copy link
Contributor

Ok, I have check this solution, and will merge it.

@florentmontesano But, I need fully refactor all code about collision system. Remember, I will rewrite
this in next releases.

@Gandifil Gandifil merged commit a3097f3 into craftworkgames:develop Aug 30, 2023
@Gandifil Gandifil self-requested a review August 30, 2023 11:34
@Gandifil Gandifil self-assigned this Aug 30, 2023
@toore toore deleted the bug-update-bounds-collision-manager branch December 4, 2023 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants