Permalink
Browse files

converts splash entry to explosion ones for projectiles with example

  • Loading branch information...
Azaezel committed Mar 4, 2017
1 parent 5c8a821 commit 4a419f4b0dfc40a934fc060b390f2de52533ba5b
@@ -219,7 +219,7 @@ void ProjectileData::initPersistFields()
addField("waterExplosion", TYPEID< ExplosionData >(), Offset(waterExplosion, ProjectileData),
"@brief Explosion datablock used when the projectile explodes underwater.\n\n");
- addField("splash", TYPEID< SplashData >(), Offset(splash, ProjectileData),
+ addField("splash", TYPEID< ExplosionData >(), Offset(splash, ProjectileData),
"@brief Splash datablock used to create splash effects as the projectile enters or leaves water\n\n");
addField("decal", TYPEID< DecalData >(), Offset(decal, ProjectileData),
@@ -909,7 +909,7 @@ void Projectile::emitParticles(const Point3F& from, const Point3F& to, const Poi
MatrixF trans = getTransform();
trans.setPosition(rInfo.point);
- Splash *splash = new Splash();
+ Explosion *splash = new Explosion();
splash->onNewDataBlock(mDataBlock->splash, false);
splash->setTransform(trans);
splash->setInitialState(trans.getPosition(), Point3F(0.0, 0.0, 1.0));
@@ -937,7 +937,7 @@ void Projectile::emitParticles(const Point3F& from, const Point3F& to, const Poi
MatrixF trans = getTransform();
trans.setPosition(rInfo.point);
- Splash *splash = new Splash();
+ Explosion *splash = new Explosion();
splash->onNewDataBlock(mDataBlock->splash,false);
splash->setTransform(trans);
splash->setInitialState(trans.getPosition(), Point3F(0.0, 0.0, 1.0));
@@ -104,7 +104,7 @@ class ProjectileData : public GameBaseData
ExplosionData* waterExplosion; // Water Explosion Datablock
S32 waterExplosionId; // Water Explosion ID
- SplashData* splash; // Water Splash Datablock
+ ExplosionData* splash; // Water Splash Datablock
S32 splashId; // Water splash ID
DecalData *decal; // (impact) Decal Datablock
@@ -231,6 +231,7 @@ datablock ProjectileData( BulletProjectile )
bounceFriction = 0;
isBallistic = false;
gravityMod = 1;
+ splash = GrenadeSplash;
};
function BulletProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
@@ -261,34 +261,13 @@ datablock ParticleEmitterData(GrenadeSplashRingEmitter)
particles = "GrenadeSplashRingParticle";
};
-datablock SplashData(GrenadeSplash)
+datablock ExplosionData(GrenadeSplash)
{
// SplashData doesn't have a render function in the source,
// so everything but the emitter array is useless here.
emitter[0] = GrenadeSplashEmitter;
emitter[1] = GrenadeSplashMistEmitter;
emitter[2] = GrenadeSplashRingEmitter;
-
- //numSegments = 15;
- //ejectionFreq = 15;
- //ejectionAngle = 40;
- //ringLifetime = 0.5;
- //lifetimeMS = 300;
- //velocity = 4.0;
- //startRadius = 0.0;
- //acceleration = -3.0;
- //texWrap = 5.0;
- //texture = "art/images/particles//splash";
-
- //colors[0] = "0.7 0.8 1.0 0.0";
- //colors[1] = "0.7 0.8 1.0 0.3";
- //colors[2] = "0.7 0.8 1.0 0.7";
- //colors[3] = "0.7 0.8 1.0 0.0";
-
- //times[0] = 0.0;
- //times[1] = 0.4;
- //times[2] = 0.8;
- //times[3] = 1.0;
};
// ----------------------------------------------------------------------------

0 comments on commit 4a419f4

Please sign in to comment.