[Orxonox-commit 1362] r6080 - code/branches/particles2/src/modules/weapons/projectiles

scheusso at orxonox.net scheusso at orxonox.net
Tue Nov 17 11:54:33 CET 2009


Author: scheusso
Date: 2009-11-17 11:54:32 +0100 (Tue, 17 Nov 2009)
New Revision: 6080

Modified:
   code/branches/particles2/src/modules/weapons/projectiles/Rocket.cc
Log:
some improvements in steering, but not yet good


Modified: code/branches/particles2/src/modules/weapons/projectiles/Rocket.cc
===================================================================
--- code/branches/particles2/src/modules/weapons/projectiles/Rocket.cc	2009-11-17 09:59:25 UTC (rev 6079)
+++ code/branches/particles2/src/modules/weapons/projectiles/Rocket.cc	2009-11-17 10:54:32 UTC (rev 6080)
@@ -110,6 +110,7 @@
         this->owner_ = owner;
             
         this->originalControllableEntity_ = this->owner_->getPlayer()->getControllableEntity();
+        this->originalControllableEntity_->setDestroyWhenPlayerLeft( false );
         this->owner_->getPlayer()->startControl(this);
     }
 
@@ -124,6 +125,19 @@
         SUPER(Rocket, tick, dt);
         
         this->setAngularVelocity(this->localAngularVelocity_);
+        this->setVelocity( (this->getOrientation()*WorldEntity::FRONT)*100 );
+        this->localAngularVelocity_ = 0;
+//         this->localLinearAcceleration_.setX(this->localLinearAcceleration_.x() * getMass() * this->auxilaryThrust_);
+//         this->localLinearAcceleration_.setY(this->localLinearAcceleration_.y() * getMass() * this->auxilaryThrust_);
+//         if (this->localLinearAcceleration_.z() > 0)
+//             this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->auxilaryThrust_);
+//         else
+//             this->localLinearAcceleration_.setZ(this->localLinearAcceleration_.z() * getMass() * this->primaryThrust_);
+//         this->physicalBody_->applyCentralForce(physicalBody_->getWorldTransform().getBasis() * this->localLinearAcceleration_);
+//         this->localLinearAcceleration_.setValue(0, 0, 0);
+//     
+//         this->localAngularAcceleration_ *= this->getLocalInertia() * this->rotationThrust_;
+//         this->physicalBody_->applyTorque(physicalBody_->getWorldTransform().getBasis() * this->localAngularAcceleration_);
     }
     
     bool Rocket::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)
@@ -180,7 +194,7 @@
     */
     void Rocket::rotateYaw(const Vector2& value)
     {
-        this->localAngularVelocity_.y = value.x;
+        this->localAngularVelocity_.x = value.x;
     }
 
     /**
@@ -191,7 +205,7 @@
     */
     void Rocket::rotatePitch(const Vector2& value)
     {
-        this->localAngularVelocity_.x = value.x;
+        this->localAngularVelocity_.y = value.x;
     }
 
     /**




More information about the Orxonox-commit mailing list