[Orxonox-commit 2186] r6902 - in code/branches/rocket/src/modules/weapons: . projectiles
gnadler at orxonox.net
gnadler at orxonox.net
Sat May 15 11:36:09 CEST 2010
Author: gnadler
Date: 2010-05-15 11:36:04 +0200 (Sat, 15 May 2010)
New Revision: 6902
Modified:
code/branches/rocket/src/modules/weapons/RocketController.cc
code/branches/rocket/src/modules/weapons/projectiles/SimpleRocket.cc
Log:
no rocket is controlled by controller. accidentally deleted tick function once :S
Modified: code/branches/rocket/src/modules/weapons/RocketController.cc
===================================================================
--- code/branches/rocket/src/modules/weapons/RocketController.cc 2010-05-15 06:47:07 UTC (rev 6901)
+++ code/branches/rocket/src/modules/weapons/RocketController.cc 2010-05-15 09:36:04 UTC (rev 6902)
@@ -63,7 +63,8 @@
haha++;
SimpleRocket *rocket = static_cast<SimpleRocket*>(this->getControllableEntity());
- rocket->moveRightLeft(5);
+ rocket->rotatePitch(0.005);
+ rocket->setVelocity(rocket->getVelocity()*1.02);
}
Modified: code/branches/rocket/src/modules/weapons/projectiles/SimpleRocket.cc
===================================================================
--- code/branches/rocket/src/modules/weapons/projectiles/SimpleRocket.cc 2010-05-15 06:47:07 UTC (rev 6901)
+++ code/branches/rocket/src/modules/weapons/projectiles/SimpleRocket.cc 2010-05-15 09:36:04 UTC (rev 6902)
@@ -92,6 +92,13 @@
void SimpleRocket::tick(float dt)
{
SUPER(SimpleRocket, tick, dt);
+
+ this->setAngularVelocity(this->getOrientation() * this->localAngularVelocity_);
+ this->setVelocity( this->getOrientation()*WorldEntity::FRONT*this->getVelocity().length() );
+
+ if( this->bDestroy_ )
+ this->destroy();
+
}
/**s
More information about the Orxonox-commit
mailing list