-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Implement support for directional armor #9268
Comments
A raycaster for hit detection happens to be a really bad idea. We need proper collision detection. This could also be implemented with some relatively simple trigonometry. On 2015-09-05, at 9:21 AM, reaperrr notifications@github.com wrote:
|
#9800 might be a big step towards making this easier. For example, for rectangular shapes we could simply check which edge is closest to the center of impact, if I'm not mistaken. |
Unfortunately, I don't think it really is. The edge detection doesn't provide direction, and could probably be done fairly simply with some vector subtraction and wangle work, but I need a sanity check to be sure. On 2016-01-01, at 10:02, reaperrr <notifications@github.commailto:notifications@github.com> wrote: #9800#9800 might be a big step towards making this easier. For example, for rectangular shapes we could simply check which edge is closest to the center of impact, if I'm not mistaken. — |
I am working on this. |
A possible, relatively simple approach would be to compare the projectile facing right before explosion with the facing of directly hit actors (explosion happened inside their health radius / hit box / whatever).
If the projectile facing exactly matched or diverted by no more than X degrees, it must have hit the weak rear armor, giving a damage bonus.
If the facing was the opposite, it must have hit the front, reducing the damage.
In between it must have hit the sides, so apply normal damage.
This is just a possibility. If we had a raycaster and rectangular hit boxes, it would be possible to check more accurately what side was hit.
The text was updated successfully, but these errors were encountered: