Only use interpolation for moving objects in VisualActor. Patch by sbte. Fixes #1846.

This was SVN commit r13223.
This commit is contained in:
quantumstate
2013-03-05 20:02:16 +00:00
parent 121fb35f72
commit 21f13f9683
5 changed files with 26 additions and 0 deletions
@@ -123,6 +123,8 @@ public:
m_RotX = m_RotY = m_RotZ = entity_angle_t::FromInt(0);
m_InterpolatedRotY = 0;
m_PositionChanged = false;
}
virtual void Deinit()
@@ -454,11 +456,18 @@ public:
m_LastX = m_X;
m_LastZ = m_Z;
m_PositionChanged = m_X != m_PrevX || m_Z != m_PrevZ;
break;
}
}
}
virtual bool GetReinterpolate()
{
return m_PositionChanged;
}
private:
void AdvertisePositionChanges()
{
@@ -472,7 +481,10 @@ private:
CMessagePositionChanged msg(GetEntityId(), false, entity_pos_t::Zero(), entity_pos_t::Zero(), entity_angle_t::Zero());
GetSimContext().GetComponentManager().PostMessage(GetEntityId(), msg);
}
m_PositionChanged = true;
}
bool m_PositionChanged;
};
REGISTER_COMPONENT_TYPE(Position)