Try to fix the remaining ipo issues
This commit is contained in:
parent
a3a5befe63
commit
2b4d062911
@ -47,9 +47,6 @@ private:
|
|||||||
* one time only (which might get triggered more than once). */
|
* one time only (which might get triggered more than once). */
|
||||||
enum AnimTimeType { ATT_CYCLIC, ATT_CYCLIC_ONCE } m_anim_type;
|
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. */
|
/** The inital position of this object. */
|
||||||
Vec3 m_initial_xyz;
|
Vec3 m_initial_xyz;
|
||||||
|
|
||||||
@ -67,6 +64,9 @@ protected:
|
|||||||
|
|
||||||
float m_animation_duration;
|
float m_animation_duration;
|
||||||
|
|
||||||
|
/** The current time used in the IPOs. */
|
||||||
|
float m_current_time;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AnimationBase(const XMLNode &node);
|
AnimationBase(const XMLNode &node);
|
||||||
AnimationBase(Ipo *ipo);
|
AnimationBase(Ipo *ipo);
|
||||||
|
@ -75,15 +75,13 @@ void ThreeDAnimation::updateWithWorldTicks()
|
|||||||
Vec3 xyz = m_object->getPosition();
|
Vec3 xyz = m_object->getPosition();
|
||||||
Vec3 scale = m_object->getScale();
|
Vec3 scale = m_object->getScale();
|
||||||
|
|
||||||
float position = 0.0f;
|
|
||||||
if (!m_is_paused)
|
if (!m_is_paused)
|
||||||
{
|
{
|
||||||
int cur_ticks = World::getWorld()->getTicksSinceStart();
|
int cur_ticks = World::getWorld()->getTicksSinceStart();
|
||||||
float cur_time = stk_config->ticks2Time(cur_ticks);
|
m_current_time = stk_config->ticks2Time(cur_ticks);
|
||||||
position = fmodf(cur_time, m_animation_duration);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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->setPosition(xyz.toIrrVector());
|
||||||
//m_node->setScale(scale.toIrrVector());
|
//m_node->setScale(scale.toIrrVector());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user