[Orxonox-commit 6280] r10937 - in code/branches/explosionChunksHS15: data/levels data/levels/templates src/libraries/tools src/modules/dodgerace src/modules/invader src/orxonox src/orxonox/items src/orxonox/worldentities src/orxonox/worldentities/pawns
vaydin at orxonox.net
vaydin at orxonox.net
Mon Dec 7 15:32:07 CET 2015
Author: vaydin
Date: 2015-12-07 15:32:07 +0100 (Mon, 07 Dec 2015)
New Revision: 10937
Modified:
code/branches/explosionChunksHS15/data/levels/HeavyCruiser.oxw
code/branches/explosionChunksHS15/data/levels/templates/spaceshipAssff.oxt
code/branches/explosionChunksHS15/data/levels/templates/spaceshipPirate.oxt
code/branches/explosionChunksHS15/src/libraries/tools/ParticleInterface.cc
code/branches/explosionChunksHS15/src/libraries/tools/ParticleInterface.h
code/branches/explosionChunksHS15/src/modules/dodgerace/DodgeRace.cc
code/branches/explosionChunksHS15/src/modules/dodgerace/DodgeRace.h
code/branches/explosionChunksHS15/src/modules/invader/Invader.cc
code/branches/explosionChunksHS15/src/orxonox/OrxonoxPrereqs.h
code/branches/explosionChunksHS15/src/orxonox/items/ShipPart.cc
code/branches/explosionChunksHS15/src/orxonox/worldentities/CMakeLists.txt
code/branches/explosionChunksHS15/src/orxonox/worldentities/ExplosionPart.cc
code/branches/explosionChunksHS15/src/orxonox/worldentities/ExplosionPart.h
code/branches/explosionChunksHS15/src/orxonox/worldentities/pawns/Pawn.cc
Log:
Finalized everything deleted now unnecessary BigExplosion
Modified: code/branches/explosionChunksHS15/data/levels/HeavyCruiser.oxw
===================================================================
--- code/branches/explosionChunksHS15/data/levels/HeavyCruiser.oxw 2015-12-07 14:21:41 UTC (rev 10936)
+++ code/branches/explosionChunksHS15/data/levels/HeavyCruiser.oxw 2015-12-07 14:32:07 UTC (rev 10937)
@@ -551,23 +551,27 @@
The first Pawn, being the ships main body, is in comments, allowing the playable SpaceShip to be spawned there instead.
All Pawns can easily be included into a level using the lua file "HeavyCruiserParts" -->
- <Pawn team=1 health=100 initialhealth=100 maxhealth=100 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=10000 name=HeavyCruiser_body radarname = "HeavyCruiser" >
+ <Pawn team=1 health=1000 initialhealth=1000 maxhealth=1000 position="0,300,-2000" yaw="180" direction="0,0,0" collisionType=dynamic mass=10000 name=HeavyCruiser_body radarname = "HeavyCruiser" >
<explosion>
- <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" size=20 />
- <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" size=20 />
- <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" size=20 />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_sparks2" scale=2.5 />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flame2" scale=2.5 />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" scale=12 />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" scale=2.5 />
- <ExplosionPart offset="50,50,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" size=20 delay=0.3 />
- <ExplosionPart offset="50,50,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" size=20 delay=0.3 />
- <ExplosionPart offset="50,50,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" size=20 delay=0.3 />
+ <ExplosionPart offset="50,50,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_sparks2" scale=2.5 delay=0.3 />
+ <ExplosionPart offset="50,50,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flame2" scale=2.5 delay=0.3 />
+ <ExplosionPart offset="50,50,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" scale=12 delay=0.3 />
+ <ExplosionPart offset="50,50,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" scale=2.5 delay=0.3 />
- <ExplosionPart offset="100,100,100" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" size=20 delay=0.6 />
- <ExplosionPart offset="100,100,100" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" size=20 delay=0.6 />
- <ExplosionPart offset="100,100,100" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" size=20 delay=0.6 />
+ <ExplosionPart offset="50,-50,-50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_sparks2" scale=2.5 delay=0.6 />
+ <ExplosionPart offset="50,-50,-50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flame2" scale=2.5 delay=0.6 />
+ <ExplosionPart offset="50,-50,-50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" scale=12 delay=0.6 />
+ <ExplosionPart offset="50,-50,-50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" scale=2.5 delay=0.6 />
- <ExplosionPart offset="150,150,150" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" size=20 delay=0.9 />
- <ExplosionPart offset="150,150,150" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" size=20 delay=0.9 />
- <ExplosionPart offset="150,150,150" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" size=20 delay=0.9 />
+ <ExplosionPart offset="-50,0,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_sparks2" scale=2.5 delay=0.9 />
+ <ExplosionPart offset="-50,0,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_flame2" scale=2.5 delay=0.9 />
+ <ExplosionPart offset="-50,0,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" scale=12 delay=0.9 />
+ <ExplosionPart offset="-50,0,50" minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" scale=2.5 delay=0.9 />
</explosion>
<attached>
<Model position="0,0,0" direction="-1,0,0" mesh="HeavyCruiser_body.mesh" scale="40" />
Modified: code/branches/explosionChunksHS15/data/levels/templates/spaceshipAssff.oxt
===================================================================
--- code/branches/explosionChunksHS15/data/levels/templates/spaceshipAssff.oxt 2015-12-07 14:21:41 UTC (rev 10936)
+++ code/branches/explosionChunksHS15/data/levels/templates/spaceshipAssff.oxt 2015-12-07 14:32:07 UTC (rev 10937)
@@ -60,10 +60,10 @@
<ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
<ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
- <ExplosionPart mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" direction="0,1,0" angle=30 />
- <ExplosionPart mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" direction="0,1,0" angle=30 />
- <ExplosionPart mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" direction="0,1,0" angle=30 />
- <ExplosionPart mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" direction="0,1,0" angle=30 />
+ <ExplosionPart mesh="CockpitDebris.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="BodyDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="WingDebris1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
+ <ExplosionPart mesh="WingDebris2.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
</explosion>
<?lua
include("../includes/weaponSettingsAssff.oxi")
Modified: code/branches/explosionChunksHS15/data/levels/templates/spaceshipPirate.oxt
===================================================================
--- code/branches/explosionChunksHS15/data/levels/templates/spaceshipPirate.oxt 2015-12-07 14:21:41 UTC (rev 10936)
+++ code/branches/explosionChunksHS15/data/levels/templates/spaceshipPirate.oxt 2015-12-07 14:32:07 UTC (rev 10937)
@@ -54,7 +54,7 @@
</collisionShapes>
<explosion>
<ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_flash2" effect2="orxonox/explosion_flame2" />
- <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" />
+ <ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_shockwave2" effect2="orxonox/explosion_sparks2" scale=2 />
<ExplosionPart minspeed=0 maxspeed=0 effect1="orxonox/explosion_streak2" effect2="orxonox/explosion_afterglow" />
<ExplosionPart mesh="explosionparts/pirate_part_1.mesh" effect1="Orxonox/fire4" effect2="Orxonox/smoke6" />
Modified: code/branches/explosionChunksHS15/src/libraries/tools/ParticleInterface.cc
===================================================================
--- code/branches/explosionChunksHS15/src/libraries/tools/ParticleInterface.cc 2015-12-07 14:21:41 UTC (rev 10936)
+++ code/branches/explosionChunksHS15/src/libraries/tools/ParticleInterface.cc 2015-12-07 14:32:07 UTC (rev 10937)
@@ -232,4 +232,9 @@
if (this->particleSystem_)
this->particleSystem_->setKeepParticlesInLocalSpace(keep);
}
+
+ void ParticleInterface::setDimensions(float scale)
+ {
+ this->particleSystem_->setDefaultDimensions(scale * this->particleSystem_->getDefaultWidth(), scale * this->particleSystem_->getDefaultHeight());
+ }
}
Modified: code/branches/explosionChunksHS15/src/libraries/tools/ParticleInterface.h
===================================================================
--- code/branches/explosionChunksHS15/src/libraries/tools/ParticleInterface.h 2015-12-07 14:21:41 UTC (rev 10936)
+++ code/branches/explosionChunksHS15/src/libraries/tools/ParticleInterface.h 2015-12-07 14:32:07 UTC (rev 10937)
@@ -74,6 +74,8 @@
void setDetailLevel(unsigned int level);
+ void setDimensions(float scale);
+
protected:
virtual void changedTimeFactor(float factor_new, float factor_old);
Modified: code/branches/explosionChunksHS15/src/modules/dodgerace/DodgeRace.cc
===================================================================
--- code/branches/explosionChunksHS15/src/modules/dodgerace/DodgeRace.cc 2015-12-07 14:21:41 UTC (rev 10936)
+++ code/branches/explosionChunksHS15/src/modules/dodgerace/DodgeRace.cc 2015-12-07 14:32:07 UTC (rev 10937)
@@ -70,10 +70,14 @@
{
for (int i = 0; i < 7; i++)
{
- BigExplosion* chunk = new BigExplosion(this->center_->getContext());
- chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
- chunk->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity()
- chunk->setScale(20);
+ WeakPtr<ExplosionPart> chunk5 = new ExplosionPart(this->center_->getContext());
+ chunk5->setPosition(Vector3(600, 0, 100.f * i - 300));
+ chunk5->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity()
+ chunk5->setScale(10);
+ chunk5->setEffect1("Orxonox/explosion2b");
+ chunk5->setEffect2("Orxonox/smoke6");
+ chunk5->Explode();
+
}
}
addPoints(multiplier * 42);
Modified: code/branches/explosionChunksHS15/src/modules/dodgerace/DodgeRace.h
===================================================================
--- code/branches/explosionChunksHS15/src/modules/dodgerace/DodgeRace.h 2015-12-07 14:21:41 UTC (rev 10936)
+++ code/branches/explosionChunksHS15/src/modules/dodgerace/DodgeRace.h 2015-12-07 14:32:07 UTC (rev 10937)
@@ -55,7 +55,6 @@
#include "infos/PlayerInfo.h"
#include "core/command/ConsoleCommand.h"
-#include "worldentities/BigExplosion.h"
#include "gametypes/Deathmatch.h"
#include "tools/Timer.h"
Modified: code/branches/explosionChunksHS15/src/modules/invader/Invader.cc
===================================================================
--- code/branches/explosionChunksHS15/src/modules/invader/Invader.cc 2015-12-07 14:21:41 UTC (rev 10936)
+++ code/branches/explosionChunksHS15/src/modules/invader/Invader.cc 2015-12-07 14:32:07 UTC (rev 10937)
@@ -50,7 +50,7 @@
#include "InvaderEnemyShooter.h"
#include "core/command/ConsoleCommand.h"
-#include "worldentities/BigExplosion.h"
+#include "worldentities/ExplosionPart.h"
namespace orxonox
{
@@ -81,10 +81,17 @@
{
for (int i = 0; i < 7; i++)
{
- BigExplosion* chunk = new BigExplosion(this->center_->getContext());
- chunk->setPosition(Vector3(600, 0, 100.f * i - 300));
- chunk->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity()
- chunk->setScale(20);
+
+ WeakPtr<ExplosionPart> chunk5 = new ExplosionPart(this->center_->getContext());
+ chunk5->setPosition(this->center_->getPosition());
+ chunk5->setVelocity(Vector3(1000, 0, 0)); //player->getVelocity()
+ chunk5->setScale(10);
+ chunk5->setEffect1("Orxonox/explosion2b");
+ chunk5->setEffect2("Orxonox/smoke6");
+ chunk5->setMinSpeed(0);
+ chunk5->setMaxSpeed(0);
+ chunk5->Explode();
+
}
}
addPoints(multiplier * 42);
Modified: code/branches/explosionChunksHS15/src/orxonox/OrxonoxPrereqs.h
===================================================================
--- code/branches/explosionChunksHS15/src/orxonox/OrxonoxPrereqs.h 2015-12-07 14:21:41 UTC (rev 10936)
+++ code/branches/explosionChunksHS15/src/orxonox/OrxonoxPrereqs.h 2015-12-07 14:32:07 UTC (rev 10937)
@@ -174,7 +174,6 @@
class WeaponSystem;
// worldentities
- class BigExplosion;
class CameraPosition;
class ControllableEntity;
class Drone;
Modified: code/branches/explosionChunksHS15/src/orxonox/items/ShipPart.cc
===================================================================
--- code/branches/explosionChunksHS15/src/orxonox/items/ShipPart.cc 2015-12-07 14:21:41 UTC (rev 10936)
+++ code/branches/explosionChunksHS15/src/orxonox/items/ShipPart.cc 2015-12-07 14:32:07 UTC (rev 10937)
@@ -40,7 +40,6 @@
#include "gametypes/Gametype.h"
#include "worldentities/StaticEntity.h"
#include "items/PartDestructionEvent.h"
-#include "worldentities/BigExplosion.h"
#include "chat/ChatManager.h"
@@ -104,10 +103,10 @@
void ShipPart::explode()
{
- BigExplosion* chunk = new BigExplosion(this->getContext());
- chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * (this->explosionPosition_));
- //chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * Vector3(this->entityList_[0]->getLocalInertia()));
- chunk->setVelocity(this->parent_->getVelocity());
+ // BigExplosion* chunk = new BigExplosion(this->getContext());
+ // chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * (this->explosionPosition_));
+ // //chunk->setPosition(this->parent_->getPosition() + this->parent_->getOrientation() * Vector3(this->entityList_[0]->getLocalInertia()));
+ // chunk->setVelocity(this->parent_->getVelocity());
// this->explosionSound_->setPosition(this->parent_->getPosition());
// this->explosionSound_->play();
Modified: code/branches/explosionChunksHS15/src/orxonox/worldentities/CMakeLists.txt
===================================================================
--- code/branches/explosionChunksHS15/src/orxonox/worldentities/CMakeLists.txt 2015-12-07 14:21:41 UTC (rev 10936)
+++ code/branches/explosionChunksHS15/src/orxonox/worldentities/CMakeLists.txt 2015-12-07 14:32:07 UTC (rev 10937)
@@ -5,7 +5,6 @@
MobileEntity.cc
ControllableEntity.cc
Drone.cc
- BigExplosion.cc
EffectContainer.cc
ExplosionChunk.cc
CameraPosition.cc
Modified: code/branches/explosionChunksHS15/src/orxonox/worldentities/ExplosionPart.cc
===================================================================
--- code/branches/explosionChunksHS15/src/orxonox/worldentities/ExplosionPart.cc 2015-12-07 14:21:41 UTC (rev 10936)
+++ code/branches/explosionChunksHS15/src/orxonox/worldentities/ExplosionPart.cc 2015-12-07 14:32:07 UTC (rev 10937)
@@ -27,6 +27,7 @@
*/
+
#include "ExplosionPart.h"
#include "core/XMLPort.h"
@@ -85,7 +86,6 @@
XMLPortParam(ExplosionPart, "offset", setOffset, getOffset, xmlelement, mode).defaultValues(Vector3::ZERO);
XMLPortParam(ExplosionPart, "direction", setDirection, getDirection, xmlelement, mode).defaultValues(Vector3(1,1,1));
XMLPortParam(ExplosionPart, "angle", setAngle, getAngle, xmlelement, mode).defaultValues(180);
- XMLPortParam(ExplosionPart, "size", setSize, getSize, xmlelement, mode).defaultValues(4);
XMLPortParam(ExplosionPart, "delay", setDelay, getDelay, xmlelement, mode).defaultValues(0);
}
@@ -119,18 +119,23 @@
//this->model_->setSyncMode(0);
+
if(effect1_ != "")
{
this->effect1Particle_ = new ParticleInterface(this->getScene()->getSceneManager(), effect1_, this->LOD_);
+ this->effect1Particle_->setDimensions(this->getScale());
this->model_->attachOgreObject(this->effect1Particle_->getParticleSystem());
}
if(effect2_ != "")
{
this->effect2Particle_ = new ParticleInterface(this->getScene()->getSceneManager(), effect2_, this->LOD_);
+ this->effect2Particle_->setDimensions(this->getScale());
this->model_->attachOgreObject(this->effect2Particle_->getParticleSystem());
}
+
+
Vector3 velocityOffset = direction_.perpendicular();
velocityOffset.normalise();
@@ -143,10 +148,12 @@
this->explosionEntity_->setVelocity(finalDirection*rnd(minSpeed_,maxSpeed_));
this->explosionEntity_->setAngularVelocity(Vector3(rnd(-1, 1), rnd(-1, 1), rnd(-1, 1)).normalisedCopy() * Degree(400).valueRadians());
- this->explosionEntity_->setScale(size_);
+ this->explosionEntity_->setScale(this->getScale() * 4);
+
this->explosionEntity_->attach(model_);
+
this->attach(explosionEntity_);
if (GameMode::isMaster())
@@ -191,7 +198,7 @@
void ExplosionPart::setOffset(Vector3 newVector)
{
this->posOffset_ = newVector;
- this->explosionEntity_->setPosition(this->getPosition() + this->posOffset_);
+ this->explosionEntity_->setPosition(this->getPosition() + this->posOffset_ / this->getScale());
}
void ExplosionPart::setDirection(Vector3 newDirection)
@@ -204,11 +211,6 @@
this->angle_ = newAngle;
}
- void ExplosionPart::setSize(float newSize)
- {
- this->size_ = newSize;
- }
-
void ExplosionPart::setDelay(float newDelay)
{
this->delay_ = newDelay;
@@ -248,11 +250,6 @@
return angle_;
}
- float ExplosionPart::getSize()
- {
- return size_;
- }
-
float ExplosionPart::getDelay()
{
return delay_;
Modified: code/branches/explosionChunksHS15/src/orxonox/worldentities/ExplosionPart.h
===================================================================
--- code/branches/explosionChunksHS15/src/orxonox/worldentities/ExplosionPart.h 2015-12-07 14:21:41 UTC (rev 10936)
+++ code/branches/explosionChunksHS15/src/orxonox/worldentities/ExplosionPart.h 2015-12-07 14:32:07 UTC (rev 10937)
@@ -71,8 +71,6 @@
Vector3 getDirection();
void setAngle(float newAgnle);
float getAngle();
- void setSize(float newSize);
- float getSize();
void setDelay(float newDelay);
float getDelay();
@@ -96,7 +94,6 @@
Vector3 posOffset_;
Vector3 direction_;
float angle_;
- float size_;
float delay_;
MovableEntity* explosionEntity_;
Modified: code/branches/explosionChunksHS15/src/orxonox/worldentities/pawns/Pawn.cc
===================================================================
--- code/branches/explosionChunksHS15/src/orxonox/worldentities/pawns/Pawn.cc 2015-12-07 14:21:41 UTC (rev 10936)
+++ code/branches/explosionChunksHS15/src/orxonox/worldentities/pawns/Pawn.cc 2015-12-07 14:32:07 UTC (rev 10937)
@@ -40,7 +40,6 @@
#include "gametypes/Gametype.h"
#include "graphics/ParticleSpawner.h"
#include "worldentities/ExplosionChunk.h"
-#include "worldentities/BigExplosion.h"
#include "worldentities/ExplosionPart.h"
#include "weaponsystem/WeaponSystem.h"
#include "weaponsystem/WeaponSlot.h"
@@ -379,9 +378,7 @@
}
void Pawn::goWithStyle()
{
- orxout() << "gowithstyle" << endl;
-
this->bAlive_ = false;
this->setDestroyWhenPlayerLeft(false);
More information about the Orxonox-commit
mailing list