Fixed replay mode.
This commit is contained in:
parent
020c129691
commit
71994c692f
@ -29,6 +29,7 @@
|
|||||||
#include "io/file_manager.hpp"
|
#include "io/file_manager.hpp"
|
||||||
#include "io/xml_node.hpp"
|
#include "io/xml_node.hpp"
|
||||||
#include "karts/abstract_kart.hpp"
|
#include "karts/abstract_kart.hpp"
|
||||||
|
#include "karts/ghost_kart.hpp"
|
||||||
#include "karts/kart_properties.hpp"
|
#include "karts/kart_properties.hpp"
|
||||||
#include "physics/btKart.hpp"
|
#include "physics/btKart.hpp"
|
||||||
#include "utils/constants.hpp"
|
#include "utils/constants.hpp"
|
||||||
@ -780,16 +781,20 @@ void KartModel::update(float dt, float rotation_dt, float steer, float speed)
|
|||||||
for(unsigned int i=0; i<4; i++)
|
for(unsigned int i=0; i<4; i++)
|
||||||
{
|
{
|
||||||
if(!m_wheel_node[i]) continue;
|
if(!m_wheel_node[i]) continue;
|
||||||
|
float rel_suspension = 0;
|
||||||
|
if (!dynamic_cast<GhostKart*>(m_kart))
|
||||||
|
{
|
||||||
const btWheelInfo &wi = m_kart->getVehicle()->getWheelInfo(i);
|
const btWheelInfo &wi = m_kart->getVehicle()->getWheelInfo(i);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
if(UserConfigParams::m_physics_debug && m_kart)
|
if (UserConfigParams::m_physics_debug && m_kart)
|
||||||
{
|
{
|
||||||
// Make wheels that are not touching the ground invisible
|
// Make wheels that are not touching the ground invisible
|
||||||
m_wheel_node[i]->setVisible(wi.m_raycastInfo.m_isInContact);
|
m_wheel_node[i]->setVisible(wi.m_raycastInfo.m_isInContact);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
float rel_suspension = wi.m_raycastInfo.m_suspensionLength
|
rel_suspension = wi.m_raycastInfo.m_suspensionLength
|
||||||
- m_default_physics_suspension[i];
|
- m_default_physics_suspension[i];
|
||||||
|
}
|
||||||
// If the suspension is too compressed
|
// If the suspension is too compressed
|
||||||
if(rel_suspension< m_min_suspension[i])
|
if(rel_suspension< m_min_suspension[i])
|
||||||
rel_suspension = m_min_suspension[i];
|
rel_suspension = m_min_suspension[i];
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include "achievements/achievement_info.hpp"
|
#include "achievements/achievement_info.hpp"
|
||||||
#include "config/player_manager.hpp"
|
#include "config/player_manager.hpp"
|
||||||
|
#include "karts/ghost_kart.hpp"
|
||||||
#include "karts/kart.hpp"
|
#include "karts/kart.hpp"
|
||||||
#include "karts/kart_gfx.hpp"
|
#include "karts/kart_gfx.hpp"
|
||||||
#include "karts/kart_properties.hpp"
|
#include "karts/kart_properties.hpp"
|
||||||
@ -79,6 +80,8 @@ void Skidding::reset()
|
|||||||
m_kart->getControls().m_skid = KartControl::SC_NONE;
|
m_kart->getControls().m_skid = KartControl::SC_NONE;
|
||||||
|
|
||||||
btVector3 rot(0, 0, 0);
|
btVector3 rot(0, 0, 0);
|
||||||
|
// Only access the vehicle if the kart is not a ghost
|
||||||
|
if (dynamic_cast<GhostKart*>(m_kart)==NULL)
|
||||||
m_kart->getVehicle()->setTimedRotation(0, rot);
|
m_kart->getVehicle()->setTimedRotation(0, rot);
|
||||||
} // reset
|
} // reset
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user