Try to fix the remaining ipo issues

This commit is contained in:
Benau 2018-07-20 14:09:27 +08:00
parent a3a5befe63
commit 2b4d062911
2 changed files with 5 additions and 7 deletions

View File

@ -47,9 +47,6 @@ private:
* one time only (which might get triggered more than once). */
enum AnimTimeType { ATT_CYCLIC, ATT_CYCLIC_ONCE } m_anim_type;
/** The current time used in the IPOs. */
float m_current_time;
/** The inital position of this object. */
Vec3 m_initial_xyz;
@ -67,6 +64,9 @@ protected:
float m_animation_duration;
/** The current time used in the IPOs. */
float m_current_time;
public:
AnimationBase(const XMLNode &node);
AnimationBase(Ipo *ipo);

View File

@ -75,15 +75,13 @@ void ThreeDAnimation::updateWithWorldTicks()
Vec3 xyz = m_object->getPosition();
Vec3 scale = m_object->getScale();
float position = 0.0f;
if (!m_is_paused)
{
int cur_ticks = World::getWorld()->getTicksSinceStart();
float cur_time = stk_config->ticks2Time(cur_ticks);
position = fmodf(cur_time, m_animation_duration);
m_current_time = stk_config->ticks2Time(cur_ticks);
}
AnimationBase::getAt(position, &xyz, &m_hpr, &scale); //updates all IPOs
AnimationBase::getAt(m_current_time, &xyz, &m_hpr, &scale); //updates all IPOs
//m_node->setPosition(xyz.toIrrVector());
//m_node->setScale(scale.toIrrVector());