- added interpolation for actor angles which for models is needed.

This commit is contained in:
Christoph Oelckers 2017-01-29 13:13:00 +01:00
commit c0ef052d07
3 changed files with 20 additions and 14 deletions

View file

@ -1318,6 +1318,14 @@ public:
{
return Prev + (ticFrac * (Pos() - Prev));
}
DRotator InterpolatedAngles(double ticFrac) const
{
DRotator result;
result.Yaw = PrevAngles.Yaw + deltaangle(PrevAngles.Yaw, Angles.Yaw) * ticFrac;
result.Pitch = PrevAngles.Pitch + deltaangle(PrevAngles.Pitch, Angles.Pitch) * ticFrac;
result.Roll = PrevAngles.Roll + deltaangle(PrevAngles.Roll, Angles.Roll) * ticFrac;
return result;
}
DVector3 PosPlusZ(double zadd) const
{
return { X(), Y(), Z() + zadd };