[Orxonox-commit 5768] r10428 - in code/branches/ParticleEffectsFS15: data data/levels data/levels/includes data/particle src/external src/external/ogreceguirenderer src/modules/weapons src/modules/weapons/projectiles src/modules/weapons/weaponmodes src/orxonox/worldentities
gpregger at orxonox.net
gpregger at orxonox.net
Thu May 7 14:29:09 CEST 2015
Author: gpregger
Date: 2015-05-07 14:29:09 +0200 (Thu, 07 May 2015)
New Revision: 10428
Added:
code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionFlame.particle
code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionFlash.particle
code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionShockwave.particle
code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionSparks.particle
code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionStreak1.particle
code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/RocketOld.cc
code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/RocketOld.h
code/branches/ParticleEffectsFS15/src/modules/weapons/weaponmodes/RocketFireOld.cc
code/branches/ParticleEffectsFS15/src/modules/weapons/weaponmodes/RocketFireOld.h
Modified:
code/branches/ParticleEffectsFS15/data/DefaultResources.oxr
code/branches/ParticleEffectsFS15/data/levels/emptyLevel.oxw
code/branches/ParticleEffectsFS15/data/levels/includes/weaponSettingsAssff.oxi
code/branches/ParticleEffectsFS15/src/external/CMakeLists.txt
code/branches/ParticleEffectsFS15/src/external/ogreceguirenderer/CMakeLists.txt
code/branches/ParticleEffectsFS15/src/modules/weapons/CMakeLists.txt
code/branches/ParticleEffectsFS15/src/modules/weapons/WeaponsPrereqs.h
code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/CMakeLists.txt
code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/Rocket.cc
code/branches/ParticleEffectsFS15/src/modules/weapons/weaponmodes/CMakeLists.txt
code/branches/ParticleEffectsFS15/src/orxonox/worldentities/CMakeLists.txt
Log:
waste of time + New Explosion in 'rocket.cc' + old Rocket in 'rocketOld.cc' with 'RocketFireOld.cc'
Modified: code/branches/ParticleEffectsFS15/data/DefaultResources.oxr
===================================================================
--- code/branches/ParticleEffectsFS15/data/DefaultResources.oxr 2015-05-07 12:22:43 UTC (rev 10427)
+++ code/branches/ParticleEffectsFS15/data/DefaultResources.oxr 2015-05-07 12:29:09 UTC (rev 10428)
@@ -9,4 +9,5 @@
<ResourceLocation path = "gui/layouts" />
<ResourceLocation path = "gui/schemes" />
<ResourceLocation path = "gui/scripts" />
+
</ResourceCollection>
Modified: code/branches/ParticleEffectsFS15/data/levels/emptyLevel.oxw
===================================================================
--- code/branches/ParticleEffectsFS15/data/levels/emptyLevel.oxw 2015-05-07 12:22:43 UTC (rev 10427)
+++ code/branches/ParticleEffectsFS15/data/levels/emptyLevel.oxw 2015-05-07 12:29:09 UTC (rev 10428)
@@ -12,7 +12,7 @@
?>
<?lua
- include("templates/spaceshipAssff2.oxt")
+ include("templates/spaceshipAssff.oxt")
include("templates/spaceshipPirate.oxt")
include("templates/spaceshipEscort.oxt")
?>
@@ -29,7 +29,7 @@
>
<Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0"/>
- <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipescort />
+ <SpawnPoint team=0 position="-200,0,0" lookat="0,0,0" spawnclass=SpaceShip pawndesign=spaceshipassff />
</Scene>
</Level>
Modified: code/branches/ParticleEffectsFS15/data/levels/includes/weaponSettingsAssff.oxi
===================================================================
--- code/branches/ParticleEffectsFS15/data/levels/includes/weaponSettingsAssff.oxi 2015-05-07 12:22:43 UTC (rev 10427)
+++ code/branches/ParticleEffectsFS15/data/levels/includes/weaponSettingsAssff.oxi 2015-05-07 12:29:09 UTC (rev 10428)
@@ -38,7 +38,7 @@
<LightningGun mode=1 muzzleoffset="0,0,0" damage=23 />
</Weapon>
<Weapon>
- <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 shielddamage=20 />
+ <SimpleRocketFire mode=2 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
<RocketFire mode=3 muzzleoffset="0,0,0" damage=30 healthdamage=50 shielddamage=20 />
</Weapon>
</WeaponPack>
Added: code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionFlame.particle
===================================================================
--- code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionFlame.particle (rev 0)
+++ code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionFlame.particle 2015-05-07 12:29:09 UTC (rev 10428)
@@ -0,0 +1,58 @@
+
+particle_system orxonox/explosion_flame
+{
+ quota 500
+ material PE/bigFlame
+ particle_width 20.52
+ particle_height 20.25
+ cull_each false
+ renderer billboard
+ billboard_type point
+
+ emitter Box
+ {
+ angle 180
+ colour 1 0.533333 0.0631577 1
+ colour_range_start 1 0.533333 0.0631577 1
+ colour_range_end 0.441667 0 0 1
+ direction 1 0 0
+ emission_rate 2000
+ position 0 0 0
+ velocity 30
+ velocity_min 30
+ velocity_max 80
+ time_to_live 0.2
+ time_to_live_min 0.2
+ time_to_live_max 3
+ duration 0.1
+ duration_min 0.1
+ duration_max 0.1
+ repeat_delay 20
+ repeat_delay_min 20
+ repeat_delay_max 20
+ width 2
+ height 2
+ depth 2
+ }
+
+ affector Scaler
+ {
+ rate 20
+ }
+
+ affector ColourFader
+ {
+ red -1
+ green -1
+ blue -1
+ alpha -1
+ }
+
+ affector Rotator
+ {
+ rotation_speed_range_start -360
+ rotation_speed_range_end 360
+ rotation_range_start 0
+ rotation_range_end 360
+ }
+}
\ No newline at end of file
Added: code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionFlash.particle
===================================================================
--- code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionFlash.particle (rev 0)
+++ code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionFlash.particle 2015-05-07 12:29:09 UTC (rev 10428)
@@ -0,0 +1,55 @@
+
+particle_system orxonox/explosion_flash
+{
+ quota 50
+ material orxonox/explosion_flash
+ particle_width 50
+ particle_height 50
+ cull_each false
+ renderer billboard
+ billboard_type point
+
+ emitter Point
+ {
+ angle 180
+ colour 1 1 1 1
+ colour_range_start 1 1 1 1
+ colour_range_end 1 1 1 1
+ direction 0 0 0
+ emission_rate 10
+ position 0 0 0
+ velocity 0
+ velocity_min 0
+ velocity_max 0
+ time_to_live 0.05
+ time_to_live_min 0.05
+ time_to_live_max 0.05
+ duration 0.1
+ duration_min 0.1
+ duration_max 0.1
+ repeat_delay 100000
+ repeat_delay_min 100000
+ repeat_delay_max 100000
+ }
+
+ affector Rotator
+ {
+ rotation_speed_range_start 0
+ rotation_speed_range_end 0
+ rotation_range_start 0
+ rotation_range_end 360
+ }
+
+ affector Scaler
+ {
+ rate 1000
+ }
+
+ affector ColourFader
+ {
+ red -1
+ green -1
+ blue -1
+ alpha -1
+ }
+}
Added: code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionShockwave.particle
===================================================================
--- code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionShockwave.particle (rev 0)
+++ code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionShockwave.particle 2015-05-07 12:29:09 UTC (rev 10428)
@@ -0,0 +1,48 @@
+
+particle_system orxonox/explosion_shockwave
+{
+ quota 4000
+ material orxonox/explosion_shockwave
+ particle_width 20
+ particle_height 20
+ cull_each false
+ renderer billboard
+ billboard_type oriented_common
+ common_direction 0 0.25 0.5
+
+ emitter Point
+ {
+ angle 0
+ colour 0.441667 0.441667 0.441667 1
+ colour_range_start 0.441667 0.441667 0.441667 1
+ colour_range_end 0.441667 0.441667 0.441667 1
+ direction 0 1 0
+ emission_rate 10
+ position 0 0 0
+ velocity 0
+ velocity_min 0
+ velocity_max 0
+ time_to_live 1
+ time_to_live_min 1
+ time_to_live_max 1
+ duration 0.1
+ duration_min 0.1
+ duration_max 0.1
+ repeat_delay 100000
+ repeat_delay_min 100000
+ repeat_delay_max 100000
+ }
+
+ affector Scaler
+ {
+ rate 500
+ }
+
+ affector ColourFader
+ {
+ red -1
+ green -1
+ blue -1
+ alpha 0
+ }
+}
Added: code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionSparks.particle
===================================================================
--- code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionSparks.particle (rev 0)
+++ code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionSparks.particle 2015-05-07 12:29:09 UTC (rev 10428)
@@ -0,0 +1,42 @@
+
+particle_system orxonox/explosion_sparks
+{
+ quota 2000
+ material PE/explosion
+ particle_width 1.5
+ particle_height 12.33
+ cull_each false
+ renderer billboard
+ billboard_type oriented_self
+
+ emitter Point
+ {
+ angle 180
+ colour 1 1 1 1
+ colour_range_start 1 1 1 1
+ colour_range_end 1 1 1 1
+ direction -0.684313 -0.325257 0.652628
+ emission_rate 1000
+ position 0 0 0
+ velocity 100
+ velocity_min 100
+ velocity_max 200
+ time_to_live 0.2
+ time_to_live_min 0.2
+ time_to_live_max 0.5
+ duration 0.1
+ duration_min 0.1
+ duration_max 0.1
+ repeat_delay 100000
+ repeat_delay_min 100000
+ repeat_delay_max 100000
+ }
+
+ affector ColourFader
+ {
+ red 0.2432
+ green -1
+ blue -1
+ alpha -1
+ }
+}
Added: code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionStreak1.particle
===================================================================
--- code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionStreak1.particle (rev 0)
+++ code/branches/ParticleEffectsFS15/data/particle/orxonox_explosionStreak1.particle 2015-05-07 12:29:09 UTC (rev 10428)
@@ -0,0 +1,42 @@
+
+particle_system orxonox/explosion_streak1
+{
+ quota 4000
+ material orxonox/explosion_streak1
+ particle_width 12.15
+ particle_height 82.13
+ cull_each false
+ renderer billboard
+ billboard_type oriented_self
+
+ emitter Point
+ {
+ angle 180
+ colour 0.191667 0.191667 0.191667 1
+ colour_range_start 0.191667 0.191667 0.191667 1
+ colour_range_end 0.191667 0.191667 0.191667 1
+ direction 0 1 0
+ emission_rate 400
+ position 0 0 0
+ velocity 30
+ velocity_min 30
+ velocity_max 100
+ time_to_live 1
+ time_to_live_min 1
+ time_to_live_max 2
+ duration 0.1
+ duration_min 0.1
+ duration_max 0.1
+ repeat_delay 20
+ repeat_delay_min 20
+ repeat_delay_max 20
+ }
+
+ affector ColourFader
+ {
+ red -0.2
+ green -0.2
+ blue -0.2
+ alpha 0
+ }
+}
Modified: code/branches/ParticleEffectsFS15/src/external/CMakeLists.txt
===================================================================
--- code/branches/ParticleEffectsFS15/src/external/CMakeLists.txt 2015-05-07 12:22:43 UTC (rev 10427)
+++ code/branches/ParticleEffectsFS15/src/external/CMakeLists.txt 2015-05-07 12:29:09 UTC (rev 10428)
@@ -26,6 +26,7 @@
ADD_SUBDIRECTORY(gmock)
ADD_SUBDIRECTORY(gtest)
ADD_SUBDIRECTORY(loki)
+
IF(CEGUI_OGRE_RENDERER_BUILD_REQUIRED)
ADD_SUBDIRECTORY(ogreceguirenderer)
ENDIF()
Modified: code/branches/ParticleEffectsFS15/src/external/ogreceguirenderer/CMakeLists.txt
===================================================================
--- code/branches/ParticleEffectsFS15/src/external/ogreceguirenderer/CMakeLists.txt 2015-05-07 12:22:43 UTC (rev 10427)
+++ code/branches/ParticleEffectsFS15/src/external/ogreceguirenderer/CMakeLists.txt 2015-05-07 12:29:09 UTC (rev 10428)
@@ -37,3 +37,8 @@
SOURCE_FILES
${OCR_FILES}
)
+
+TARGET_LINK_LIBRARIES(ogreceguirenderer_orxonox
+ pthread
+ boost_system
+)
Modified: code/branches/ParticleEffectsFS15/src/modules/weapons/CMakeLists.txt
===================================================================
--- code/branches/ParticleEffectsFS15/src/modules/weapons/CMakeLists.txt 2015-05-07 12:22:43 UTC (rev 10427)
+++ code/branches/ParticleEffectsFS15/src/modules/weapons/CMakeLists.txt 2015-05-07 12:29:09 UTC (rev 10428)
@@ -18,3 +18,7 @@
objects
SOURCE_FILES ${WEAPONS_SRC_FILES}
)
+
+#TARGET_LINK_LIBRARIES(weapons
+# particleuniverse_orxonox
+#)
Modified: code/branches/ParticleEffectsFS15/src/modules/weapons/WeaponsPrereqs.h
===================================================================
--- code/branches/ParticleEffectsFS15/src/modules/weapons/WeaponsPrereqs.h 2015-05-07 12:22:43 UTC (rev 10427)
+++ code/branches/ParticleEffectsFS15/src/modules/weapons/WeaponsPrereqs.h 2015-05-07 12:29:09 UTC (rev 10428)
@@ -81,6 +81,7 @@
class ParticleProjectile;
class Projectile;
class Rocket;
+ class RocketOld;
class SimpleRocket;
// weaponmodes
@@ -90,6 +91,7 @@
class LaserFire;
class LightningGun;
class RocketFire;
+ class RocketFireOld;
class SimpleRocketFire;
}
Modified: code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/CMakeLists.txt
===================================================================
--- code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/CMakeLists.txt 2015-05-07 12:22:43 UTC (rev 10427)
+++ code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/CMakeLists.txt 2015-05-07 12:29:09 UTC (rev 10428)
@@ -5,5 +5,6 @@
Projectile.cc
LightningGunProjectile.cc
Rocket.cc
+ RocketOld.cc
SimpleRocket.cc
)
Modified: code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/Rocket.cc
===================================================================
--- code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/Rocket.cc 2015-05-07 12:22:43 UTC (rev 10427)
+++ code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/Rocket.cc 2015-05-07 12:29:09 UTC (rev 10428)
@@ -47,6 +47,7 @@
#include "sound/WorldSound.h"
#include "worldentities/CameraPosition.h"
#include "worldentities/pawns/Pawn.h"
+//#include "particleuniverse/include/ParticleUniverseSystemManager.h"
namespace orxonox
{
@@ -82,6 +83,11 @@
this->attach(fire);
fire->setOrientation(this->getOrientation());
fire->setSource("Orxonox/rocketfire");
+
+ // Add Particle Universe Effects
+ //ParticleUniverse::ParticleSystemManager* pManager = ParticleUniverse::ParticleSystemManager::getSingletonPtr();
+ //ParticleUniverse::ParticleSystem* pSys1 = pManager->createParticleSystem("pSys1", "bubbles", this->getScene()->getSceneManager());
+ //this->attachOgreObject(pSys1);
this->enableCollisionCallback();
this->setCollisionResponse(false);
@@ -222,29 +228,53 @@
*/
void Rocket::destructionEffect()
{
- ParticleSpawner *effect1, *effect2;
+ ParticleSpawner *effect1, *effect2, *effect3, *effect4, *effect5;
if(this->getShooter())
{
effect1 = new ParticleSpawner(this->getShooter()->getContext());
effect2 = new ParticleSpawner(this->getShooter()->getContext());
+ effect3 = new ParticleSpawner(this->getShooter()->getContext());
+ effect4 = new ParticleSpawner(this->getShooter()->getContext());
+ effect5 = new ParticleSpawner(this->getShooter()->getContext());
}
else
{
effect1 = new ParticleSpawner(this->getContext());
effect2 = new ParticleSpawner(this->getContext());
+ effect3 = new ParticleSpawner(this->getContext());
+ effect4 = new ParticleSpawner(this->getContext());
+ effect5 = new ParticleSpawner(this->getContext());
}
effect1->setPosition(this->getPosition());
effect1->setOrientation(this->getOrientation());
effect1->setDestroyAfterLife(true);
- effect1->setSource("Orxonox/explosion4");
+ effect1->setSource("orxonox/explosion_flash");
effect1->setLifetime(2.0f);
effect2->setPosition(this->getPosition());
effect2->setOrientation(this->getOrientation());
effect2->setDestroyAfterLife(true);
- effect2->setSource("Orxonox/smoke4");
+ effect2->setSource("orxonox/explosion_flame");
effect2->setLifetime(3.0f);
+
+ effect3->setPosition(this->getPosition());
+ effect3->setOrientation(this->getOrientation());
+ effect3->setDestroyAfterLife(true);
+ effect3->setSource("orxonox/explosion_shockwave");
+ effect3->setLifetime(3.0f);
+
+ effect4->setPosition(this->getPosition());
+ effect4->setOrientation(this->getOrientation());
+ effect4->setDestroyAfterLife(true);
+ effect4->setSource("orxonox/explosion_sparks");
+ effect4->setLifetime(3.0f);
+
+ effect5->setPosition(this->getPosition());
+ effect5->setOrientation(this->getOrientation());
+ effect5->setDestroyAfterLife(true);
+ effect5->setSource("orxonox/explosion_streak1");
+ effect5->setLifetime(3.0f);
}
/**
Added: code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/RocketOld.cc
===================================================================
--- code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/RocketOld.cc (rev 0)
+++ code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/RocketOld.cc 2015-05-07 12:29:09 UTC (rev 10428)
@@ -0,0 +1,298 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Oliver Scheuss
+ * Co-authors:
+ * simonmie
+ *
+ */
+
+/**
+ @file RocketOld.h
+ @brief Implementation of the RocketOld class.
+*/
+
+#include "RocketOld.h"
+
+#include <BulletDynamics/Dynamics/btRigidBody.h>
+
+#include "core/CoreIncludes.h"
+#include "core/XMLPort.h"
+
+#include "Scene.h"
+#include "controllers/Controller.h"
+#include "graphics/Model.h"
+#include "graphics/ParticleSpawner.h"
+#include "infos/PlayerInfo.h"
+#include "objects/collisionshapes/ConeCollisionShape.h"
+#include "sound/WorldSound.h"
+#include "worldentities/CameraPosition.h"
+#include "worldentities/pawns/Pawn.h"
+//#include "particleuniverse/include/ParticleUniverseSystemManager.h"
+
+namespace orxonox
+{
+ RegisterClass(RocketOld);
+
+ /**
+ @brief
+ Constructor. Registers the object and initializes some default values.
+ */
+ RocketOld::RocketOld(Context* context)
+ : ControllableEntity(context)
+ , BasicProjectile()
+ , RadarViewable(this, static_cast<WorldEntity*>(this))
+ {
+ RegisterObject(RocketOld);// Register the RocketOld class to the core
+
+ this->localAngularVelocity_ = 0;
+ this->lifetime_ = 100.0f;
+
+ if (GameMode::isMaster())
+ {
+ this->setCollisionType(WorldEntity::Kinematic);
+ this->setVelocity(0,0,-100);
+
+ // Create RocketOld model
+ Model* model = new Model(this->getContext());
+ model->setMeshSource("rocket.mesh");
+ model->scale(0.7f);
+ this->attach(model);
+
+ // Add effects.
+ ParticleEmitter* fire = new ParticleEmitter(this->getContext());
+ this->attach(fire);
+ fire->setOrientation(this->getOrientation());
+ fire->setSource("Orxonox/rocketfire");
+
+ // Add Particle Universe Effects
+ //ParticleUniverse::ParticleSystemManager* pManager = ParticleUniverse::ParticleSystemManager::getSingletonPtr();
+ //ParticleUniverse::ParticleSystem* pSys1 = pManager->createParticleSystem("pSys1", "bubbles", this->getScene()->getSceneManager());
+ //this->attachOgreObject(pSys1);
+
+ this->enableCollisionCallback();
+ this->setCollisionResponse(false);
+ this->setCollisionType(Kinematic);
+
+ // Add collision shape
+ ConeCollisionShape* collisionShape = new ConeCollisionShape(this->getContext());
+ collisionShape->setRadius(3);
+ collisionShape->setHeight(500);
+ this->attachCollisionShape(collisionShape);
+
+ this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&BasicProjectile::destroyObject, this)));
+
+ // Add sound
+ this->defSndWpnEngine_ = new WorldSound(this->getContext());
+ this->defSndWpnEngine_->setLooping(true);
+ this->defSndWpnEngine_->setSource("sounds/Rocket_engine.ogg");
+ this->defSndWpnEngine_->setVolume(1.0f);
+ this->attach(defSndWpnEngine_);
+
+ this->defSndWpnLaunch_ = new WorldSound(this->getContext());
+ this->defSndWpnLaunch_->setLooping(false);
+ this->defSndWpnLaunch_->setSource("sounds/Rocket_launch.ogg");
+ this->defSndWpnLaunch_->setVolume(1.0f);
+ this->attach(defSndWpnLaunch_);
+ }
+ else
+ {
+ this->defSndWpnEngine_ = 0;
+ this->defSndWpnLaunch_ = 0;
+ }
+
+ // Add camera
+ CameraPosition* camPosition = new CameraPosition(this->getContext());
+ camPosition->setPosition(0,4,15);
+ camPosition->setAllowMouseLook(true);
+ this->addCameraPosition(camPosition);
+
+ this->setRadarObjectColour(ColourValue(1.0, 0.5, 0.0)); // orange
+ this->setRadarObjectShape(RadarViewable::Triangle);
+ this->setRadarObjectScale(0.5f);
+ }
+
+ /**
+ @brief
+ Destructor. Destroys controller, if present and kills sounds, if playing.
+ */
+ RocketOld::~RocketOld()
+ {
+ if(this->isInitialized())
+ {
+ if (GameMode::isMaster())
+ {
+ this->destructionEffect();
+
+ if (this->getPlayer() && this->getController())
+ this->player_->stopTemporaryControl();
+ }
+
+ if ( this->defSndWpnEngine_ )
+ this->defSndWpnEngine_->destroy();
+
+ if ( this->defSndWpnLaunch_ )
+ this->defSndWpnLaunch_->destroy();
+ }
+ }
+
+ /**
+ @brief
+ Sets the entity that fired the RocketOld.
+ @param shooter
+ A pointer to the Pawn that fired the RocketOld.
+ */
+ void RocketOld::setShooter(Pawn* shooter)
+ {
+ this->BasicProjectile::setShooter(shooter);
+
+ this->player_ = this->getShooter()->getPlayer();
+ if(this->player_)
+ this->player_->startTemporaryControl(this);
+
+ if( GameMode::isMaster() )
+ {
+ this->defSndWpnEngine_->play();
+ this->defSndWpnLaunch_->play();
+ }
+ }
+
+ /**
+ @brief
+ Defines which actions the RocketOld has to take in each tick.
+ @param dt
+ The length of the tick.
+ */
+ void RocketOld::tick(float dt)
+ {
+ SUPER(RocketOld, tick, dt);
+
+ if( this->hasLocalController() )
+ {
+ this->setAngularVelocity(this->getOrientation() * this->localAngularVelocity_);
+ this->setVelocity( this->getOrientation()*WorldEntity::FRONT*this->getVelocity().length() );
+ this->localAngularVelocity_ = 0;
+ }
+
+ this->destroyCheck();
+ }
+
+ bool RocketOld::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint)
+ {
+ return this->processCollision(otherObject, contactPoint, cs);
+ }
+
+ /**
+ @brief
+ Destroys the RocketOld and stops the sound,
+ */
+ void RocketOld::destroyObject(void)
+ {
+ if (GameMode::isMaster() && this->defSndWpnEngine_->isPlaying())
+ this->defSndWpnEngine_->stop();
+
+ this->BasicProjectile::destroyObject();
+ }
+
+ /**
+ @brief
+ Destroys the RocketOld upon pressing "fire".
+ */
+ void RocketOld::fired(unsigned int firemode)
+ {
+ this->destroyObject();
+ }
+
+ /**
+ @brief
+ The effects that are displayed, when the RocketOld is destroyed.
+ */
+ void RocketOld::destructionEffect()
+ {
+ ParticleSpawner *effect1, *effect2;
+ if(this->getShooter())
+ {
+ effect1 = new ParticleSpawner(this->getShooter()->getContext());
+ effect2 = new ParticleSpawner(this->getShooter()->getContext());
+ }
+ else
+ {
+ effect1 = new ParticleSpawner(this->getContext());
+ effect2 = new ParticleSpawner(this->getContext());
+ }
+
+ effect1->setPosition(this->getPosition());
+ effect1->setOrientation(this->getOrientation());
+ effect1->setDestroyAfterLife(true);
+ effect1->setSource("Orxonox/explosion4");
+ effect1->setLifetime(2.0f);
+
+ effect2->setPosition(this->getPosition());
+ effect2->setOrientation(this->getOrientation());
+ effect2->setDestroyAfterLife(true);
+ effect2->setSource("Orxonox/smoke4");
+ effect2->setLifetime(3.0f);
+ }
+
+ /**
+ @brief
+ Rotates the RocketOld around the y-axis by the amount specified by the first component of the input 2-dim vector.
+ @param value
+ The vector determining the amount of the angular movement.
+ */
+ void RocketOld::rotateYaw(const Vector2& value)
+ {
+ ControllableEntity::rotateYaw(value);
+
+ if( !this->isInMouseLook() )
+ this->localAngularVelocity_.y += value.x;
+ }
+
+ /**
+ @brief
+ Rotates the RocketOld around the x-axis by the amount specified by the first component of the input 2-dim vector.
+ @param value
+ The vector determining the amount of the angular movement.
+ */
+ void RocketOld::rotatePitch(const Vector2& value)
+ {
+ ControllableEntity::rotatePitch(value);
+
+ if( !this->isInMouseLook() )
+ this->localAngularVelocity_.x += value.x;
+ }
+
+ /**
+ @brief
+ Rotates the RocketOld around the z-axis by the amount specified by the first component of the input 2-dim vector.
+ @param value
+ The vector determining the amount of the angular movement.
+ */
+ void RocketOld::rotateRoll(const Vector2& value)
+ {
+ ControllableEntity::rotateRoll(value);
+
+ if( !this->isInMouseLook() )
+ this->localAngularVelocity_.z += value.x;
+ }
+
+}
Added: code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/RocketOld.h
===================================================================
--- code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/RocketOld.h (rev 0)
+++ code/branches/ParticleEffectsFS15/src/modules/weapons/projectiles/RocketOld.h 2015-05-07 12:29:09 UTC (rev 10428)
@@ -0,0 +1,134 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Oliver Scheuss
+ * Co-authors:
+ * simonmie
+ *
+ */
+
+/**
+ @file RocketOld.h
+ @brief Definition of the RocketOld class.
+*/
+
+#ifndef _RocketOld_H__
+#define _RocketOld_H__
+
+#include "weapons/WeaponsPrereqs.h"
+
+#include "tools/Timer.h"
+
+#include "interfaces/RadarViewable.h"
+#include "worldentities/ControllableEntity.h"
+
+#include "BasicProjectile.h"
+
+namespace orxonox
+{
+ class ConeCollisionShape;
+
+ /**
+ @brief
+ RocketOld that can be steered by the player.
+
+ @author
+ Oli Scheuss
+ @ingroup WeaponsProjectiles
+ */
+ class _WeaponsExport RocketOld : public ControllableEntity, public BasicProjectile, public RadarViewable
+ {
+ public:
+ RocketOld(Context* context);
+ virtual ~RocketOld();
+
+ virtual void tick(float dt); //!< Defines which actions the RocketOld has to take in each tick.
+
+ virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
+ virtual void destroyObject(void);
+ void destructionEffect();
+
+ virtual void moveFrontBack(const Vector2& value) {}
+ virtual void moveRightLeft(const Vector2& value) {}
+ virtual void moveUpDown(const Vector2& value) {}
+
+ virtual void rotateYaw(const Vector2& value);
+ virtual void rotatePitch(const Vector2& value);
+ virtual void rotateRoll(const Vector2& value);
+
+ /**
+ @brief Moves the RocketOld in the Front/Back-direction by the specifed amount.
+ @param value The amount by which the RocketOld is to be moved.
+ */
+ inline void moveFrontBack(float value)
+ { this->moveFrontBack(Vector2(value, 0)); }
+ /**
+ @brief Moves the RocketOld in the Right/Left-direction by the specifed amount.
+ @param value The amount by which the RocketOld is to be moved.
+ */
+ inline void moveRightLeft(float value)
+ { this->moveRightLeft(Vector2(value, 0)); }
+ /**
+ @brief Moves the RocketOld in the Up/Down-direction by the specifed amount.
+ @param value The amount by which the RocketOld is to be moved.
+ */
+ inline void moveUpDown(float value)
+ { this->moveUpDown(Vector2(value, 0)); }
+
+ /**
+ @brief Rotates the RocketOld around the y-axis by the specifed amount.
+ @param value The amount by which the RocketOld is to be rotated.
+ */
+ inline void rotateYaw(float value)
+ { this->rotateYaw(Vector2(value, 0)); }
+ /**
+ @brief Rotates the RocketOld around the x-axis by the specifed amount.
+ @param value The amount by which the RocketOld is to be rotated.
+ */
+ inline void rotatePitch(float value)
+ { this->rotatePitch(Vector2(value, 0)); }
+ /**
+ @brief Rotates the RocketOld around the z-axis by the specifed amount.
+ @param value The amount by which the RocketOld is to be rotated.
+ */
+ inline void rotateRoll(float value)
+ { this->rotateRoll(Vector2(value, 0)); }
+
+ virtual void setShooter(Pawn* shooter);
+
+ virtual void fired(unsigned int firemode);
+
+ private:
+ Vector3 localAngularVelocity_; //!< Variable to temporarily store accumulated steering command input.
+
+ WeakPtr<PlayerInfo> player_; //!< The player that controls the RocketOld.
+ //WeakPtr<Pawn> pawn_; //!< The pawn that controls the RocketOld. TODO
+ Timer destroyTimer_; //!< Timer to destroy the projectile after its lifetime has run out.
+ float lifetime_; //!< The time the projectile exists.
+
+ WorldSound* defSndWpnEngine_; //!< Engine sound.
+ WorldSound* defSndWpnLaunch_; //!< Launch sound.
+ };
+
+}
+
+#endif /* _RocketOld_H__ */
Modified: code/branches/ParticleEffectsFS15/src/modules/weapons/weaponmodes/CMakeLists.txt
===================================================================
--- code/branches/ParticleEffectsFS15/src/modules/weapons/weaponmodes/CMakeLists.txt 2015-05-07 12:22:43 UTC (rev 10427)
+++ code/branches/ParticleEffectsFS15/src/modules/weapons/weaponmodes/CMakeLists.txt 2015-05-07 12:29:09 UTC (rev 10428)
@@ -5,5 +5,6 @@
HsW01.cc
LightningGun.cc
RocketFire.cc
+ RocketFireOld.cc
SimpleRocketFire.cc
)
Added: code/branches/ParticleEffectsFS15/src/modules/weapons/weaponmodes/RocketFireOld.cc
===================================================================
--- code/branches/ParticleEffectsFS15/src/modules/weapons/weaponmodes/RocketFireOld.cc (rev 0)
+++ code/branches/ParticleEffectsFS15/src/modules/weapons/weaponmodes/RocketFireOld.cc 2015-05-07 12:29:09 UTC (rev 10428)
@@ -0,0 +1,86 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Oliver Scheuss
+ * Co-authors:
+ * simonmie
+ *
+ */
+
+/**
+ @file RocketFire.h
+ @brief Implementation of the RocketFire class.
+*/
+
+#include "RocketFireOld.h"
+
+#include "core/CoreIncludes.h"
+#include "util/Math.h"
+
+#include "weaponsystem/Weapon.h"
+#include "weaponsystem/WeaponPack.h"
+#include "weaponsystem/WeaponSystem.h"
+#include "worldentities/pawns/Pawn.h"
+
+#include "weapons/projectiles/RocketOld.h"
+
+namespace orxonox
+{
+ RegisterClass(RocketFireOld);
+
+ RocketFireOld::RocketFireOld(Context* context) : WeaponMode(context)
+ {
+ RegisterObject(RocketFireOld);
+
+ this->reloadTime_ = 0.20f;
+ this->bParallelReload_ = false;
+ this->damage_ = 0.0f;
+ this->speed_ = 500.0f;
+
+ this->setMunitionName("RocketMunition");
+ // The firing sound of the Rocket is played in Rocket.cc (because of OpenAl sound positioning)
+ }
+
+ RocketFireOld::~RocketFireOld()
+ {
+ }
+
+ /**
+ @brief
+ Fires the weapon. Creates the Rocket and fires it.
+ */
+ void RocketFireOld::fire()
+ {
+ RocketOld* rocket = new RocketOld(this->getContext());
+
+ this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
+ rocket->setOrientation(this->getMuzzleOrientation());
+ rocket->setPosition(this->getMuzzlePosition());
+ rocket->setVelocity(this->getMuzzleDirection() * this->speed_);
+ rocket->scale(2);
+
+ rocket->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
+ rocket->setDamage(this->getDamage());
+ rocket->setShieldDamage(this->getShieldDamage());
+ rocket->setHealthDamage(this->getHealthDamage());
+ }
+}
Added: code/branches/ParticleEffectsFS15/src/modules/weapons/weaponmodes/RocketFireOld.h
===================================================================
--- code/branches/ParticleEffectsFS15/src/modules/weapons/weaponmodes/RocketFireOld.h (rev 0)
+++ code/branches/ParticleEffectsFS15/src/modules/weapons/weaponmodes/RocketFireOld.h 2015-05-07 12:29:09 UTC (rev 10428)
@@ -0,0 +1,63 @@
+/*
+ * ORXONOX - the hottest 3D action shooter ever to exist
+ * > www.orxonox.net <
+ *
+ *
+ * License notice:
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * Author:
+ * Oliver Scheuss
+ * Co-authors:
+ * ...
+ *
+ */
+
+/**
+ @file RocketFireOld.h
+ @brief Definition of the RocketFire class.
+*/
+
+#ifndef _RocketFireOld_H__
+#define _RocketFireOld_H__
+
+#include "weapons/WeaponsPrereqs.h"
+#include "weaponsystem/WeaponMode.h"
+
+namespace orxonox
+{
+
+ /**
+ @brief
+ Fires the (steerable) RocketOld.
+ @author
+ Oliver Scheuss
+ @ingroup WeaponsWeaponModes
+ */
+ class _WeaponsExport RocketFireOld : public WeaponMode
+ {
+ public:
+ RocketFireOld(Context* context);
+ virtual ~RocketFireOld();
+
+ virtual void fire();
+
+ private:
+ float speed_; //!< The speed of the Rocket.
+ };
+}
+
+#endif /* _RocketFireOld_H__ */
Modified: code/branches/ParticleEffectsFS15/src/orxonox/worldentities/CMakeLists.txt
===================================================================
--- code/branches/ParticleEffectsFS15/src/orxonox/worldentities/CMakeLists.txt 2015-05-07 12:22:43 UTC (rev 10427)
+++ code/branches/ParticleEffectsFS15/src/orxonox/worldentities/CMakeLists.txt 2015-05-07 12:29:09 UTC (rev 10428)
@@ -11,6 +11,7 @@
CameraPosition.cc
SpawnPoint.cc
TeamSpawnPoint.cc
+
)
ADD_SUBDIRECTORY(pawns)
More information about the Orxonox-commit
mailing list