Clean skidmark earlier if there are many karts
This commit is contained in:
parent
969592e3fc
commit
a339975df6
@ -72,8 +72,10 @@
|
|||||||
delta-angle="0.5" />
|
delta-angle="0.5" />
|
||||||
|
|
||||||
<!-- Skidmark data: maximum number of skid marks, and
|
<!-- Skidmark data: maximum number of skid marks, and
|
||||||
time for skidmarks to fade out. -->
|
time for skidmarks to fade out. Maximum number will over
|
||||||
<skid-marks max-number="100" fadeout-time="60"/>
|
current number of karts, so the more karts, the less
|
||||||
|
skidmark is on track. -->
|
||||||
|
<skid-marks max-number="500" fadeout-time="60"/>
|
||||||
|
|
||||||
<!-- Defines when the upright constraint should be active, it's
|
<!-- Defines when the upright constraint should be active, it's
|
||||||
disabled when the kart is more than this value from the track. -->
|
disabled when the kart is more than this value from the track. -->
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include "karts/controller/controller.hpp"
|
#include "karts/controller/controller.hpp"
|
||||||
#include "karts/abstract_kart.hpp"
|
#include "karts/abstract_kart.hpp"
|
||||||
#include "karts/skidding.hpp"
|
#include "karts/skidding.hpp"
|
||||||
|
#include "modes/world.hpp"
|
||||||
#include "physics/btKart.hpp"
|
#include "physics/btKart.hpp"
|
||||||
|
|
||||||
#include <IMeshSceneNode.h>
|
#include <IMeshSceneNode.h>
|
||||||
@ -208,7 +209,9 @@ void SkidMarks::update(float dt, bool force_skid_marks,
|
|||||||
// The scene node will keep the mesh alive.
|
// The scene node will keep the mesh alive.
|
||||||
new_mesh->drop();
|
new_mesh->drop();
|
||||||
m_current++;
|
m_current++;
|
||||||
if(m_current>=stk_config->m_max_skidmarks)
|
int cleaning_threshold =
|
||||||
|
core::clamp(int(World::getWorld()->getNumKarts()), 5, 15);
|
||||||
|
if(m_current>=int(stk_config->m_max_skidmarks/cleaning_threshold))
|
||||||
m_current = 0;
|
m_current = 0;
|
||||||
if(m_current>=(int)m_left.size())
|
if(m_current>=(int)m_left.size())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user