[Orxonox-commit 4188] r8859 - code/trunk/src/modules/weapons/projectiles
landauf at orxonox.net
landauf at orxonox.net
Tue Aug 23 00:58:23 CEST 2011
Author: landauf
Date: 2011-08-23 00:58:21 +0200 (Tue, 23 Aug 2011)
New Revision: 8859
Modified:
code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc
code/trunk/src/modules/weapons/projectiles/SimpleRocket.h
Log:
fixed build for MSVC: "only static const integral data members can be initialized within a class"
Modified: code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc
===================================================================
--- code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc 2011-08-22 22:45:53 UTC (rev 8858)
+++ code/trunk/src/modules/weapons/projectiles/SimpleRocket.cc 2011-08-22 22:58:21 UTC (rev 8859)
@@ -51,9 +51,10 @@
namespace orxonox
{
-
CreateFactory(SimpleRocket);
+ const float SimpleRocket::FUEL_PERCENTAGE = 0.8f;
+
SimpleRocket::SimpleRocket(BaseObject* creator)
: ControllableEntity(creator)
, BasicProjectile()
@@ -94,7 +95,7 @@
collisionShape->setRadius(1.5f);
collisionShape->setHeight(5);
this->attachCollisionShape(collisionShape);
-
+
this->destroyTimer_.setTimer(this->lifetime_, false, createExecutor(createFunctor(&BasicProjectile::destroyObject, this)));
}
@@ -114,7 +115,7 @@
void SimpleRocket::tick(float dt)
{
SUPER(SimpleRocket, tick, dt);
-
+
if (GameMode::isMaster())
{
this->setAngularVelocity(this->getOrientation() * this->localAngularVelocity_);
@@ -166,7 +167,7 @@
void SimpleRocket::setShooter(Pawn* shooter)
{
BasicProjectile::setShooter(shooter);
-
+
this->player_ = this->getShooter()->getPlayer();
}
Modified: code/trunk/src/modules/weapons/projectiles/SimpleRocket.h
===================================================================
--- code/trunk/src/modules/weapons/projectiles/SimpleRocket.h 2011-08-22 22:45:53 UTC (rev 8858)
+++ code/trunk/src/modules/weapons/projectiles/SimpleRocket.h 2011-08-22 22:58:21 UTC (rev 8859)
@@ -121,8 +121,8 @@
private:
- static const float FUEL_PERCENTAGE = 0.8f; //!< Percentage of lifetime the rocket has fuel
-
+ static const float FUEL_PERCENTAGE; //!< Percentage of lifetime the rocket has fuel
+
Vector3 localAngularVelocity_; //!< Variable to temporarily store accumulated steering command input.
bool fuel_; //!< Bool is true while the rocket "has fuel"
More information about the Orxonox-commit
mailing list