Add ImpactOrientation to WarheadArgs

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.
This commit is contained in:
reaperrr
2019-09-26 17:14:11 +02:00
committed by teinarss
parent bf7fecff10
commit 8513a83331
9 changed files with 80 additions and 10 deletions

View File

@@ -108,6 +108,15 @@ namespace OpenRA.Mods.Common
return WPos.Lerp(fromPos, toPos, 1, 2);
}
public static WAngle GetVerticalAngle(WPos source, WPos target)
{
var delta = target - source;
var horizontalDelta = delta.HorizontalLength;
var verticalVector = new WVec(-delta.Z, -horizontalDelta, 0);
return verticalVector.Yaw;
}
public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> ts, MersenneTwister random)
{
// Fisher-Yates