Here's the code:
Code: Select all
simulated function rotator AddSpread(rotator BaseAim)
{
local vector X, Y, Z;
local float CurrentSpread, RandY, RandZ;
CurrentSpread = Spread[CurrentFireMode];
if (CurrentSpread == 0)
{
return BaseAim;
}
else
{
// Add in any spread.
GetAxes(BaseAim, X, Y, Z);
RandY = FRand() - 0.5;
RandZ = Sqrt(0.5 - Square(RandY)) * (FRand() - 0.5);
return rotator(X + RandY * CurrentSpread * Y + RandZ * CurrentSpread * Z);
}
}
return rotator(X + RandY * CurrentSpread * Y + RandZ * CurrentSpread * Z);
I can't tell where the X, Y, and Z values separate, or specifically, what separates them? By my logic it is simply multiplying it all into one big number. I thought the values were separated by a comma, something like this:
return rotator(X + RandY * CurrentSpread, Y + RandZ * CurrentSpread, Z);
Can someone tell me how it separates those values?