Fix smoke particles to not hardcode rate
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@7330 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
ffc6fd299c
commit
8a3b74a951
@ -10,8 +10,8 @@
|
|||||||
<material file="smoke.png" />
|
<material file="smoke.png" />
|
||||||
|
|
||||||
<!-- Amount of particles emitted per second -->
|
<!-- Amount of particles emitted per second -->
|
||||||
<rate min="5"
|
<rate min="100"
|
||||||
max="10" />
|
max="250" />
|
||||||
|
|
||||||
<!-- Minimal and maximal lifetime of a particle, in milliseconds. -->
|
<!-- Minimal and maximal lifetime of a particle, in milliseconds. -->
|
||||||
<lifetime min="300"
|
<lifetime min="300"
|
||||||
|
@ -1555,7 +1555,6 @@ void Kart::updateGraphics(const Vec3& offset_xyz,
|
|||||||
|
|
||||||
if (m_terrain_particles)
|
if (m_terrain_particles)
|
||||||
{
|
{
|
||||||
float f = 0.0f;
|
|
||||||
const Material* material = getMaterial();
|
const Material* material = getMaterial();
|
||||||
|
|
||||||
if (material != NULL)
|
if (material != NULL)
|
||||||
@ -1567,9 +1566,10 @@ void Kart::updateGraphics(const Vec3& offset_xyz,
|
|||||||
{
|
{
|
||||||
m_terrain_particles->setParticleType(pk);
|
m_terrain_particles->setParticleType(pk);
|
||||||
|
|
||||||
if (fabsf(m_controls.m_steer) > 0.8 && isOnGround()) f = 250.0f;
|
if (fabsf(m_controls.m_steer) > 0.8 && isOnGround())
|
||||||
|
{
|
||||||
m_terrain_particles->setCreationRate((m_skidding-1)*f);
|
float rate = m_skidding - 1;
|
||||||
|
m_terrain_particles->setCreationRate(pk->getMinRate() + rate*(pk->getMaxRate() - pk->getMinRate()));
|
||||||
|
|
||||||
m_wheel_toggle = 1 - m_wheel_toggle;
|
m_wheel_toggle = 1 - m_wheel_toggle;
|
||||||
const btWheelInfo &wi = getVehicle()->getWheelInfo(2 + m_wheel_toggle);
|
const btWheelInfo &wi = getVehicle()->getWheelInfo(2 + m_wheel_toggle);
|
||||||
@ -1581,6 +1581,11 @@ void Kart::updateGraphics(const Vec3& offset_xyz,
|
|||||||
c.getZ() + 0.06f));
|
c.getZ() + 0.06f));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
m_terrain_particles->setCreationRate(0.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
m_terrain_particles->setCreationRate(0);
|
m_terrain_particles->setCreationRate(0);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user