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

Added ImpactRotation and ImpactPosition to WarheadArgs #17971

Merged
merged 2 commits into from
Jul 12, 2020

Conversation

reaperrr
Copy link
Contributor

See commits for more details.

Mostly for downstream projects for now.

I'll provide an example testcase soon (probably tomorrow).

@Mailaender
Copy link
Member

Both ImpactPosition and ImpactRotation seem to be unused. Why do you want to set those at time of impact? Wouldn't it make more sense for a projectile to get rotation at launch to match the launcher or rotate it while it is in the air and flying an arch?

@reaperrr
Copy link
Contributor Author

Because for warheads, only the projectile position and rotation at the moment of impact matters, I don't see the point in setting them earlier or updating on the fly (that would just cost performance).

I'm using them downstream for my directional armor implementation, which I might submit upstream after this (not sure if my approach would get conceptual approval, but maybe it will).

@reaperrr
Copy link
Contributor Author

Note: I'll hold off rebasing this until #18023 is merged (which hopefully won't take too much longer).

Copy link
Member

@pchote pchote left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one naming comment/question.

I haven't tried testing this yet because this doesn't touch anything used in the upstream mods.

OpenRA.Game/GameRules/WeaponInfo.cs Outdated Show resolved Hide resolved
Allows to pass the horizontal facing/yaw
and vertical angle/pitch of the carrier
projectile to warheads for further use.

Add ImpactPosition to WarheadArgs

InflictDamage doesn't pass the impact pos
directly, and the very point of WarheadArgs
is to avoid adding more and more arguments
to the warhead methods.
The ImpactOrientation needs to be computed from
point of impact to target if the target wasn't hit directly.

Also adapted warhead code to use WarheadArgs consistently,
as well as pass HitShape instead of just HitShapeInfo
(both needed for future and/or downstream features).
@reaperrr
Copy link
Contributor Author

reaperrr commented Jul 5, 2020

Rebased and updated.

Note: Due to rebase conflicts caused by the recent Facing int->WAngle changes, I decided to merge the first 2 commits to save me from more rebase conflict hell.

@teinarss teinarss merged commit baf58f5 into OpenRA:bleed Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants