SuperTuxKart 1.5 upstream source (from official release tarball)
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0"?>
|
||||
<!-- Generated with script from SVN rev 17016 -->
|
||||
<scene>
|
||||
<object type="movable" id="stklib_fitchBarrel_a_bodyPartA" xyz="-0.23 1.19 0.02" hpr="0.0 -0.0 0.0" scale="1.00 1.00 1.00"
|
||||
shape="box" mass="25.0" model="stklib_fitchBarrel_a_bodyPartA.spm" if="false" skeletal-animation="false"/>
|
||||
<object type="movable" id="stklib_fitchBarrel_a_bodyPartB" xyz="-0.18 1.06 0.21" hpr="0.0 -0.0 0.0" scale="1.00 1.00 1.00"
|
||||
shape="box" mass="25.0" model="stklib_fitchBarrel_a_bodyPartB.spm" if="false" skeletal-animation="false"/>
|
||||
<object type="movable" id="stklib_fitchBarrel_a_bodyPartC" xyz="-0.16 1.33 -0.04" hpr="0.0 -0.0 0.0" scale="1.00 1.00 1.00"
|
||||
shape="box" mass="25.0" model="stklib_fitchBarrel_a_bodyPartC.spm" if="false" skeletal-animation="false"/>
|
||||
<object type="movable" id="stklib_fitchBarrel_a_bodyPartD" xyz="-0.08 1.11 0.12" hpr="0.0 -0.0 0.0" scale="1.00 1.00 1.00"
|
||||
shape="box" mass="25.0" model="stklib_fitchBarrel_a_bodyPartD.spm" if="false" skeletal-animation="false"/>
|
||||
<object type="movable" id="stklib_fitchBarrel_a_bodyPartE" xyz="-0.27 1.11 -0.03" hpr="0.0 -0.0 0.0" scale="1.00 1.00 1.00"
|
||||
shape="box" mass="25.0" model="stklib_fitchBarrel_a_bodyPartE.spm" if="false" skeletal-animation="false"/>
|
||||
<object type="movable" id="stklib_fitchBarrel_a_bottom" xyz="-0.04 0.18 0.03" hpr="0.0 -0.0 0.0" scale="1.00 1.00 1.00"
|
||||
shape="cylinderY" mass="25.0" model="stklib_fitchBarrel_a_bottom.spm" if="false" skeletal-animation="false"/>
|
||||
<object type="movable" id="stklib_fitchBarrel_a_cover" xyz="-0.06 2.28 0.02" hpr="1.4 -0.7 15.1" scale="1.00 1.00 1.00"
|
||||
shape="cylinderY" mass="50.0" model="stklib_fitchBarrel_a_cover.spm" if="false" skeletal-animation="false"/>
|
||||
<object id="stklib_fitchBarrel_a_main" type="animation" xyz="0.00 0.00 0.00" hpr="0.0 -0.0 0.0" scale="1.00 1.00 1.00" interaction="static" shape="cylinderY" model="stklib_fitchBarrel_a_main.spm" skeletal-animation="false" on-kart-collision="onFitchBarrelCollision">
|
||||
</object>
|
||||
<particle-emitter kind="gfx_sandExplosion_a.xml" id="stklib_fitchBarrel_a_sandExplosion" xyz="-0.02 0.13 0.00" h="0.00" auto_emit="false">
|
||||
</particle-emitter>
|
||||
</scene>
|
||||
@@ -0,0 +1,83 @@
|
||||
void onFitchBarrelCollision(int idKart, const string libraryInstance, const string objID)
|
||||
{
|
||||
if (Utils::isNetworking())
|
||||
return;
|
||||
//Utils::logInfo("Wall Collision! Kart " + idKart + " with obj " + objID + " from " + libraryInstance);
|
||||
Vec3 velocity = Kart::getVelocity(idKart);
|
||||
//Utils::logInfo("Kart velocity : " + velocity.getLength());
|
||||
if (velocity.getLength() > 2.5)
|
||||
blowUpFitchBarrel(libraryInstance);
|
||||
}
|
||||
|
||||
class FitchBarrelTimeout
|
||||
{
|
||||
string instID;
|
||||
|
||||
FitchBarrelTimeout(string instID)
|
||||
{
|
||||
this.instID = instID;
|
||||
}
|
||||
|
||||
void onTimerComplete()
|
||||
{
|
||||
|
||||
array<string> barrel_parts = {
|
||||
"stklib_fitchBarrel_a_cover",
|
||||
"stklib_fitchBarrel_a_bodyPartA",
|
||||
"stklib_fitchBarrel_a_bodyPartB",
|
||||
"stklib_fitchBarrel_a_bodyPartC",
|
||||
"stklib_fitchBarrel_a_bodyPartD",
|
||||
"stklib_fitchBarrel_a_bodyPartE",
|
||||
"stklib_fitchBarrel_a_bottom"
|
||||
};
|
||||
|
||||
uint counter = 0;
|
||||
while(counter < barrel_parts.length())
|
||||
{
|
||||
Track::TrackObject@ part = Track::getTrackObject(this.instID, barrel_parts[counter]);
|
||||
part.setEnabled(false);
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void blowUpFitchBarrel(string instID)
|
||||
{
|
||||
Track::TrackObject@ wall = Track::getTrackObject(instID, "stklib_fitchBarrel_a_main");
|
||||
wall.setEnabled(false);
|
||||
|
||||
array<string> barrel_parts = {
|
||||
"stklib_fitchBarrel_a_cover",
|
||||
"stklib_fitchBarrel_a_bodyPartA",
|
||||
"stklib_fitchBarrel_a_bodyPartB",
|
||||
"stklib_fitchBarrel_a_bodyPartC",
|
||||
"stklib_fitchBarrel_a_bodyPartD",
|
||||
"stklib_fitchBarrel_a_bodyPartE",
|
||||
"stklib_fitchBarrel_a_bottom"
|
||||
};
|
||||
|
||||
uint counter = 0;
|
||||
while(counter < barrel_parts.length())
|
||||
{
|
||||
Track::TrackObject@ part = Track::getTrackObject(instID, barrel_parts[counter]);
|
||||
part.setEnabled(true);
|
||||
counter++;
|
||||
}
|
||||
|
||||
Track::TrackObject@ obj = Track::getTrackObject(instID, "stklib_fitchBarrel_a_sandExplosion");
|
||||
if (obj !is null)
|
||||
{
|
||||
// Will be null if particles are disabled
|
||||
Track::ParticleEmitter@ emitter = obj.getParticleEmitter();
|
||||
emitter.setEmissionRate(1.0);
|
||||
emitter.stopIn(0.1);
|
||||
}
|
||||
|
||||
FitchBarrelTimeout@ timeout = FitchBarrelTimeout(instID);
|
||||
Utils::TimeoutCallback@ timerDelegate = Utils::TimeoutCallback(timeout.onTimerComplete);
|
||||
Utils::setTimeoutDelegate(timerDelegate, 20.0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
Reference in New Issue
Block a user