-
-
Notifications
You must be signed in to change notification settings - Fork 545
Allow to ignore multiple objects when checking for collisions #3197
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
base: master
Are you sure you want to change the base?
Conversation
|
Oops, accidentally reviewed sorry |
|
|
Maybe |
MatusGuy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe there's a better way of fixing this. For the BadGuy, you can detect if the object hit by the raycast is static, or, in other words, either COLGROUP_MOVING or COLGROUP_MOVING_STATIC.
If it's really needed to ignore objects (which is not the case in might_fall) we can think about this later. I'm rewriting these functions sooner anyway
Hypernoot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually fixes only the case when the bug is triggered by the player. But it can be triggered by any object in the group COLGROUP_MOVING. Problem is, that the group COLGROUP_MOVING sometimes acts as solid (the case of badguys) and sometimes acts as non-solid (the case of powerups and the player). Therefore, a badguy may still stand temporarily on COLGROUP_MOVING. Therefore, the correct behaviour would be:
- If the badguy stands on
COLGROUP_STATICorCOLGROUP_MOVING_STATIC, then refuse to walk onCOLGROUP_MOVING. - If the badguy stands on
COLGROUP_MOVING, then don't test for walkable ground. I guess that badguys are not supposed to walk on top of each other permanently.
Basically, it's in the title.
Currently, only one object can be set as ignore object for the collision system. This is alright when we want to prevent self-collisions. However, sometimes multiple objects need to be ignored. For example in case of ledge behaviour where we want to prevent badguys from assuming players can be walked on.
Therefore, I changed
GameObject* ignore_objecttoconst std::vector<GameObject*>&.Furthermore, I've changed the code to ignore players when checking whether the badguy may fall because we don't want badguys to consider players as suitable target for continuing to walk when their ledge behaviour is set to stay on the platform.
Fixes #3194