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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user