[Orxonox-commit 5676] r10336 - in code/branches/weaponFS15/src/modules/weapons: . projectiles
meggiman at orxonox.net
meggiman at orxonox.net
Thu Mar 26 16:14:44 CET 2015
Author: meggiman
Date: 2015-03-26 16:14:43 +0100 (Thu, 26 Mar 2015)
New Revision: 10336
Added:
code/branches/weaponFS15/src/modules/weapons/projectiles/GravityBomb.cc
Modified:
code/branches/weaponFS15/src/modules/weapons/WeaponsPrereqs.h
code/branches/weaponFS15/src/modules/weapons/projectiles/CMakeLists.txt
code/branches/weaponFS15/src/modules/weapons/projectiles/GravityBomb.h
Log:
Started implementing GravityBomb.cc
Modified: code/branches/weaponFS15/src/modules/weapons/WeaponsPrereqs.h
===================================================================
--- code/branches/weaponFS15/src/modules/weapons/WeaponsPrereqs.h 2015-03-26 14:26:26 UTC (rev 10335)
+++ code/branches/weaponFS15/src/modules/weapons/WeaponsPrereqs.h 2015-03-26 15:14:43 UTC (rev 10336)
@@ -82,6 +82,7 @@
class Projectile;
class Rocket;
class SimpleRocket;
+ class GravityBomb;
// weaponmodes
class EnergyDrink;
Modified: code/branches/weaponFS15/src/modules/weapons/projectiles/CMakeLists.txt
===================================================================
--- code/branches/weaponFS15/src/modules/weapons/projectiles/CMakeLists.txt 2015-03-26 14:26:26 UTC (rev 10335)
+++ code/branches/weaponFS15/src/modules/weapons/projectiles/CMakeLists.txt 2015-03-26 15:14:43 UTC (rev 10336)
@@ -6,4 +6,5 @@
LightningGunProjectile.cc
Rocket.cc
SimpleRocket.cc
+ GravityBomb.cc
)
Added: code/branches/weaponFS15/src/modules/weapons/projectiles/GravityBomb.cc
===================================================================
--- code/branches/weaponFS15/src/modules/weapons/projectiles/GravityBomb.cc (rev 0)
+++ code/branches/weaponFS15/src/modules/weapons/projectiles/GravityBomb.cc 2015-03-26 15:14:43 UTC (rev 10336)
@@ -0,0 +1,48 @@
+/*
+ * GravityBomb.cc
+ *
+ * Created on: Mar 26, 2015
+ * Author: meggiman
+ */
+#include "GravityBomb.h"
+
+
+namespace orxonox{
+ RegisterClass(GravityBomb);
+
+ const float GravityBomb::FUEL_START = 10;
+ const float GravityBomb::FORCE_SPHERE_START_RADIUS = 30;
+ const float GravityBomb::FORCE_SPHERE_START_STRENGTH = 100;
+
+ GravityBomb::GravityBomb(Context* context):
+ BasicProjectile(),
+ MovableEntity(context),
+ RadarViewable(this,static_cast<WorldEntity*>(this))
+ {
+ RegisterObject(GravityBomb);
+ this->lifetime_=FUEL_START;
+ this->forceSphereRadius_= FORCE_SPHERE_START_RADIUS;
+ this->forceStrength_ = FORCE_SPHERE_START_STRENGTH;
+
+ ForceField* field = new ForceField(context);
+ field->setMode("sphere");
+ field->setDiameter(this->forceSphereRadius_);
+ field->setVelocity(this->forceStrength_);
+ this->attach(field);
+
+ }
+
+ GravityBomb::~GravityBomb(){}
+
+ void GravityBomb::tick(float dt)
+ {
+
+ }
+
+ bool GravityBomb::collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint)
+ {
+ return true;
+ }
+}
+
+
Modified: code/branches/weaponFS15/src/modules/weapons/projectiles/GravityBomb.h
===================================================================
--- code/branches/weaponFS15/src/modules/weapons/projectiles/GravityBomb.h 2015-03-26 14:26:26 UTC (rev 10335)
+++ code/branches/weaponFS15/src/modules/weapons/projectiles/GravityBomb.h 2015-03-26 15:14:43 UTC (rev 10336)
@@ -43,22 +43,36 @@
#include "graphics/ParticleSpawner.h"
#include "interfaces/RadarViewable.h"
-
+#include "objects/ForceField.h"
#include "BasicProjectile.h"
+#include "worldentities/MovableEntity.h"
+#include "core/CoreIncludes.h"
namespace orxonox
{
class ConeCollisionShape;
- class _WeaponsExport GravityBomb : public BasicProjectile , public RadarViewable, public MovableEntity
+ class _WeaponsExport GravityBomb : public BasicProjectile , public MovableEntity, public RadarViewable
{
public:
GravityBomb(Context* context);
+ virtual ~GravityBomb();
+ virtual void tick(float dt);
+ virtual bool collidesAgainst(WorldEntity* otherObject, const btCollisionShape* cs, btManifoldPoint& contactPoint);
+
private:
+ static const float FUEL_START;
+ static const float FORCE_SPHERE_START_RADIUS;
+ static const float FORCE_SPHERE_START_STRENGTH;
+
+ float fuel_;
float lifetime_;
+ float forceSphereRadius_;
+ float forceStrength_;
- }
+
+ };
}
#endif /* GravityBOMB_H_ */
More information about the Orxonox-commit
mailing list