add FloatBobStrength Actor property, a multiplier on Z offset created by FloatBob behavior. default of 1.0 is current behavior, set higher/lower for more/less extreme bobbing.

This commit is contained in:
jplebreton 2017-06-03 08:42:57 -07:00 committed by Christoph Oelckers
commit 2c7a0c87c8
5 changed files with 16 additions and 1 deletions

View file

@ -282,6 +282,7 @@ DEFINE_FIELD(AActor, Floorclip)
DEFINE_FIELD(AActor, DamageType)
DEFINE_FIELD(AActor, DamageTypeReceived)
DEFINE_FIELD(AActor, FloatBobPhase)
DEFINE_FIELD(AActor, FloatBobStrength)
DEFINE_FIELD(AActor, RipperLevel)
DEFINE_FIELD(AActor, RipLevelMin)
DEFINE_FIELD(AActor, RipLevelMax)
@ -443,6 +444,7 @@ void AActor::Serialize(FSerializer &arc)
("inventory", Inventory)
A("inventoryid", InventoryID)
A("floatbobphase", FloatBobPhase)
A("floatbobstrength", FloatBobStrength)
A("translation", Translation)
A("bloodcolor", BloodColor)
A("bloodtranslation", BloodTranslation)
@ -7988,7 +7990,7 @@ double AActor::GetBobOffset(double ticfrac) const
{
return 0;
}
return BobSin(FloatBobPhase + level.maptime + ticfrac);
return BobSin(FloatBobPhase + level.maptime + ticfrac) * FloatBobStrength;
}
DEFINE_ACTION_FUNCTION(AActor, GetBobOffset)