Fix valgrind errors
This commit is contained in:
parent
4a72a79582
commit
75a5f81578
@ -130,12 +130,19 @@ void GhostKart::update(int ticks)
|
|||||||
const float rd = gc->getReplayDelta();
|
const float rd = gc->getReplayDelta();
|
||||||
assert(idx < m_all_transform.size());
|
assert(idx < m_all_transform.size());
|
||||||
|
|
||||||
setXYZ((1- rd)*m_all_transform[idx ].getOrigin()
|
if (idx >= m_all_transform.size() - 1)
|
||||||
+ rd *m_all_transform[idx + 1].getOrigin() );
|
{
|
||||||
|
setXYZ(m_all_transform.back().getOrigin());
|
||||||
const btQuaternion q = m_all_transform[idx].getRotation()
|
setRotation(m_all_transform.back().getRotation());
|
||||||
.slerp(m_all_transform[idx + 1].getRotation(), rd);
|
}
|
||||||
setRotation(q);
|
else
|
||||||
|
{
|
||||||
|
setXYZ((1- rd)*m_all_transform[idx ].getOrigin()
|
||||||
|
+ rd *m_all_transform[idx + 1].getOrigin() );
|
||||||
|
const btQuaternion q = m_all_transform[idx].getRotation()
|
||||||
|
.slerp(m_all_transform[idx + 1].getRotation(), rd);
|
||||||
|
setRotation(q);
|
||||||
|
}
|
||||||
|
|
||||||
Moveable::updatePosition();
|
Moveable::updatePosition();
|
||||||
float dt = stk_config->ticks2Time(ticks);
|
float dt = stk_config->ticks2Time(ticks);
|
||||||
@ -235,8 +242,8 @@ float GhostKart::getSpeed() const
|
|||||||
|
|
||||||
assert(gc->getCurrentReplayIndex() < m_all_physic_info.size());
|
assert(gc->getCurrentReplayIndex() < m_all_physic_info.size());
|
||||||
|
|
||||||
if (current_index == m_all_physic_info.size())
|
if (current_index >= m_all_physic_info.size() - 1)
|
||||||
return m_all_physic_info[current_index].m_speed;
|
return m_all_physic_info.back().m_speed;
|
||||||
|
|
||||||
return (1-rd)*m_all_physic_info[current_index ].m_speed
|
return (1-rd)*m_all_physic_info[current_index ].m_speed
|
||||||
+ rd *m_all_physic_info[current_index + 1].m_speed;
|
+ rd *m_all_physic_info[current_index + 1].m_speed;
|
||||||
|
Loading…
Reference in New Issue
Block a user