[Orxonox-commit 4566] r9237 - in code/branches/spacebomb/src/modules/weapons: projectiles weaponmodes
mpalic at orxonox.net
mpalic at orxonox.net
Thu May 24 15:06:57 CEST 2012
Author: mpalic
Date: 2012-05-24 15:06:56 +0200 (Thu, 24 May 2012)
New Revision: 9237
Modified:
code/branches/spacebomb/src/modules/weapons/projectiles/SimpleRocket.cc
code/branches/spacebomb/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
Log:
Modified SimpleRocket to be able to use it for the SpaceBomb
Modified: code/branches/spacebomb/src/modules/weapons/projectiles/SimpleRocket.cc
===================================================================
--- code/branches/spacebomb/src/modules/weapons/projectiles/SimpleRocket.cc 2012-05-24 08:00:06 UTC (rev 9236)
+++ code/branches/spacebomb/src/modules/weapons/projectiles/SimpleRocket.cc 2012-05-24 13:06:56 UTC (rev 9237)
@@ -43,12 +43,17 @@
#include "graphics/Model.h"
#include "graphics/ParticleSpawner.h"
#include "infos/PlayerInfo.h"
-#include "objects/collisionshapes/ConeCollisionShape.h"
+#include "objects/collisionshapes/SphereCollisionShape.h"
#include "worldentities/pawns/Pawn.h"
#include "sound/WorldSound.h"
#include "weapons/RocketController.h"
+// NOTE this branch now has the spacebomb implementation in
+// the simplerocket facilities since there is no time to implement
+// a proper weapon for it now. DO NOT MERGE THIS INTO TRUNK.
+
+
namespace orxonox
{
CreateFactory(SimpleRocket);
@@ -63,7 +68,7 @@
RegisterObject(SimpleRocket);// Register the SimpleRocket class to the core
this->localAngularVelocity_ = 0;
- this->lifetime_ = 10.f;
+ this->lifetime_ = 100.f;
this->setMass(15.0);
@@ -74,26 +79,21 @@
// Create rocket model.
Model* model = new Model(this);
- model->setMeshSource("rocket.mesh");
- model->scale(0.7f);
+ model->setMeshSource("Spacebomb.mesh");
+ model->scale(0.3f);
this->attach(model);
// Add effects.
- this->fire_ = new ParticleEmitter(this);
- this->attach(this->fire_);
-
- this->fire_->setOrientation(this->getOrientation());
- this->fire_->setSource("Orxonox/simplerocketfire");
+
this->enableCollisionCallback();
this->setCollisionResponse(false);
this->setCollisionType(Kinematic);
// Add collision shape.
// TODO: fix the orientation and size of this collision shape to match the rocket
- ConeCollisionShape* collisionShape = new ConeCollisionShape(this);
+ SphereCollisionShape* collisionShape = new SphereCollisionShape(this);
collisionShape->setOrientation(this->getOrientation());
- collisionShape->setRadius(1.5f);
- collisionShape->setHeight(5);
+ collisionShape->setRadius(50.00f);
this->attachCollisionShape(collisionShape);
this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&BasicProjectile::destroyObject, this)));
@@ -101,7 +101,7 @@
this->setRadarObjectColour(ColourValue(1.0, 1.0, 0.0)); // yellow
this->setRadarObjectShape(RadarViewable::Triangle);
- this->setRadarObjectScale(0.5f);
+ this->setRadarObjectScale(0.3f);
}
@@ -140,7 +140,7 @@
void SimpleRocket::disableFire()
{
this->setAcceleration(0,0,0);
- this->fire_->detachFromParent();
+
}
/**
Modified: code/branches/spacebomb/src/modules/weapons/weaponmodes/SimpleRocketFire.cc
===================================================================
--- code/branches/spacebomb/src/modules/weapons/weaponmodes/SimpleRocketFire.cc 2012-05-24 08:00:06 UTC (rev 9236)
+++ code/branches/spacebomb/src/modules/weapons/weaponmodes/SimpleRocketFire.cc 2012-05-24 13:06:56 UTC (rev 9237)
@@ -80,7 +80,7 @@
this->computeMuzzleParameters(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getAimPosition());
rocket->setOrientation(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn()->getWorldOrientation());
rocket->setPosition(this->getMuzzlePosition());
- rocket->setVelocity(this->getMuzzleDirection()*this->speed_);
+ rocket->setVelocity(0.0f,0.0f,0.0f);
rocket->setShooter(this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn());
rocket->setDamage(this->damage_);
More information about the Orxonox-commit
mailing list