Tweaked skidding particles by Deve
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@12642 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
34fb38fd1a
commit
5bd8f58923
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<particles emitter="box" box_x="0.1" box_y="0.1" box_z="-0.8">
|
||||
<particles emitter="box" box_x="0.023" box_y="0.023" box_z="-0.5">
|
||||
|
||||
<spreading angle="10" />
|
||||
<spreading angle="5" />
|
||||
|
||||
<velocity x="0.0"
|
||||
y="0.001"
|
||||
@ -20,8 +20,8 @@
|
||||
max="10" />
|
||||
|
||||
<!-- Size of the particles -->
|
||||
<size min="1.1"
|
||||
max="1.1" />
|
||||
<size min="0.35"
|
||||
max="0.35" />
|
||||
|
||||
<color min="255 255 255"
|
||||
max="255 255 255" />
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
<particles emitter="box" box_x="0.1" box_y="0.1" box_z="-0.8">
|
||||
<particles emitter="box" box_x="0.023" box_y="0.023" box_z="-0.5">
|
||||
|
||||
<spreading angle="10" />
|
||||
<spreading angle="5" />
|
||||
|
||||
<velocity x="0.0"
|
||||
y="0.001"
|
||||
@ -20,8 +20,8 @@
|
||||
max="10" />
|
||||
|
||||
<!-- Size of the particles -->
|
||||
<size min="1.1"
|
||||
max="1.1" />
|
||||
<size min="0.35"
|
||||
max="0.35" />
|
||||
|
||||
<color min="255 255 255"
|
||||
max="255 255 255" />
|
||||
|
@ -41,6 +41,12 @@ KartGFX::KartGFX(const AbstractKart *kart)
|
||||
|
||||
m_kart = kart;
|
||||
|
||||
Vec3 rear_left(-(kart->getKartWidth()+0.20)*0.35f, (kart->getKartHeight()-0.6)*0.35f,
|
||||
-kart->getKartLength()*0.35f);
|
||||
|
||||
Vec3 rear_right((kart->getKartWidth()+0.20)*0.35f, (kart->getKartHeight()-0.6)*0.35f,
|
||||
-kart->getKartLength()*0.35f);
|
||||
|
||||
Vec3 rear_center(0, kart->getKartHeight()*0.35f,
|
||||
-kart->getKartLength()*0.35f);
|
||||
|
||||
@ -49,9 +55,10 @@ KartGFX::KartGFX(const AbstractKart *kart)
|
||||
addEffect(KGFX_NITRO, "nitro.xml", rear_center);
|
||||
addEffect(KGFX_ZIPPER, "zipper_fire.xml", rear_center);
|
||||
addEffect(KGFX_TERRAIN, "smoke.xml", Vec3(0,0,0));
|
||||
addEffect(KGFX_SKID1, "skid1.xml", rear_center);
|
||||
addEffect(KGFX_SKID2, "skid2.xml", rear_center);
|
||||
|
||||
addEffect(KGFX_SKID1L, "skid1.xml", rear_left);
|
||||
addEffect(KGFX_SKID1R, "skid1.xml", rear_right);
|
||||
addEffect(KGFX_SKID2L, "skid2.xml", rear_left);
|
||||
addEffect(KGFX_SKID2R, "skid2.xml", rear_right);
|
||||
} // KartGFX
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -86,7 +93,7 @@ void KartGFX::addEffect(KartGFXType type, const std::string &file_name,
|
||||
//kind = new ParticleKind(file_manager->getGfxFile(file_name));
|
||||
// Skid2 is only used to store the emitter type, and a wheeless
|
||||
// kart has no terrain effects.
|
||||
if(type==KGFX_SKID2 || (type==KGFX_TERRAIN && m_kart->isWheeless()) )
|
||||
if(type==KGFX_SKID2L || type==KGFX_SKID2R || (type==KGFX_TERRAIN && m_kart->isWheeless()) )
|
||||
emitter = NULL;
|
||||
else if(type==KGFX_TERRAIN)
|
||||
// Terrain is NOT a child of the kart, since bullet returns the
|
||||
@ -107,9 +114,9 @@ void KartGFX::addEffect(KartGFXType type, const std::string &file_name,
|
||||
}
|
||||
assert((int)m_all_emitters.size()==type);
|
||||
m_all_emitters.push_back(emitter);
|
||||
if(type==KGFX_SKID1)
|
||||
if(type==KGFX_SKID1L or type==KGFX_SKID1R)
|
||||
m_skid_kind1 = kind;
|
||||
else if (type==KGFX_SKID2)
|
||||
else if (type==KGFX_SKID2L or type==KGFX_SKID2R)
|
||||
m_skid_kind2 = kind;
|
||||
} // addEffect
|
||||
|
||||
@ -139,11 +146,14 @@ void KartGFX::setSkidLevel(const unsigned int level)
|
||||
assert(level >= 1);
|
||||
assert(level <= 2);
|
||||
const ParticleKind *pk = level==1 ? m_skid_kind1 : m_skid_kind2;
|
||||
if(m_all_emitters[KGFX_SKID1])
|
||||
m_all_emitters[KGFX_SKID1]->setParticleType(pk);
|
||||
if(m_all_emitters[KGFX_SKID1L])
|
||||
m_all_emitters[KGFX_SKID1L]->setParticleType(pk);
|
||||
if(m_all_emitters[KGFX_SKID1R])
|
||||
m_all_emitters[KGFX_SKID1R]->setParticleType(pk);
|
||||
// Relative 0 means it will emitt the minimum rate, i.e. the rate
|
||||
// set to indicate that the bonus is now available.
|
||||
setCreationRateRelative(KartGFX::KGFX_SKID, 0.0f);
|
||||
setCreationRateRelative(KartGFX::KGFX_SKIDL, 0.0f);
|
||||
setCreationRateRelative(KartGFX::KGFX_SKIDR, 0.0f);
|
||||
} // setSkidLevel
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -42,9 +42,12 @@ public:
|
||||
enum KartGFXType { KGFX_NITRO=0,
|
||||
KGFX_ZIPPER,
|
||||
KGFX_TERRAIN,
|
||||
KGFX_SKID,
|
||||
KGFX_SKID1=KGFX_SKID,
|
||||
KGFX_SKID2,
|
||||
KGFX_SKIDL,
|
||||
KGFX_SKIDR,
|
||||
KGFX_SKID1L = KGFX_SKIDL,
|
||||
KGFX_SKID1R = KGFX_SKIDR,
|
||||
KGFX_SKID2L,
|
||||
KGFX_SKID2R,
|
||||
KGFX_COUNT};
|
||||
|
||||
private:
|
||||
|
@ -71,7 +71,8 @@ void Skidding::reset()
|
||||
m_gfx_jump_offset = 0.0f;
|
||||
m_remaining_jump_time = 0.0f;
|
||||
m_jump_speed = 0.0f;
|
||||
m_kart->getKartGFX()->setCreationRateAbsolute(KartGFX::KGFX_SKID, 0);
|
||||
m_kart->getKartGFX()->setCreationRateAbsolute(KartGFX::KGFX_SKIDL, 0);
|
||||
m_kart->getKartGFX()->setCreationRateAbsolute(KartGFX::KGFX_SKIDR, 0);
|
||||
} // reset
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -376,16 +377,21 @@ void Skidding::update(float dt, bool is_on_ground,
|
||||
if(bonus_time>0)
|
||||
{
|
||||
m_kart->getKartGFX()
|
||||
->setCreationRateRelative(KartGFX::KGFX_SKID, 1.0f);
|
||||
->setCreationRateRelative(KartGFX::KGFX_SKIDL, 1.0f);
|
||||
m_kart->getKartGFX()
|
||||
->setCreationRateRelative(KartGFX::KGFX_SKIDR, 1.0f);
|
||||
m_kart->m_max_speed->
|
||||
instantSpeedIncrease(MaxSpeed::MS_INCREASE_SKIDDING,
|
||||
bonus_speed, bonus_speed,
|
||||
bonus_force, bonus_time,
|
||||
/*fade-out-time*/ 1.0f);
|
||||
}
|
||||
else
|
||||
else {
|
||||
m_kart->getKartGFX()
|
||||
->setCreationRateAbsolute(KartGFX::KGFX_SKID, 0);
|
||||
->setCreationRateAbsolute(KartGFX::KGFX_SKIDL, 0);
|
||||
m_kart->getKartGFX()
|
||||
->setCreationRateAbsolute(KartGFX::KGFX_SKIDR, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
} // case
|
||||
@ -396,7 +402,9 @@ void Skidding::update(float dt, bool is_on_ground,
|
||||
{
|
||||
m_skid_time = 0;
|
||||
m_kart->getKartGFX()
|
||||
->setCreationRateAbsolute(KartGFX::KGFX_SKID, 0);
|
||||
->setCreationRateAbsolute(KartGFX::KGFX_SKIDL, 0);
|
||||
m_kart->getKartGFX()
|
||||
->setCreationRateAbsolute(KartGFX::KGFX_SKIDR, 0);
|
||||
m_skid_state = SKID_NONE;
|
||||
}
|
||||
} // switch
|
||||
|
Loading…
Reference in New Issue
Block a user