[Orxonox-commit 7786] r12378 - in code/branches/OrxoBlox_FS19: data/levels data/levels/includes src/modules/weapons/projectiles src/modules/weapons/weaponmodes

pomselj at orxonox.net pomselj at orxonox.net
Thu May 16 14:53:00 CEST 2019


Author: pomselj
Date: 2019-05-16 14:53:00 +0200 (Thu, 16 May 2019)
New Revision: 12378

Modified:
   code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi
   code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
   code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc
   code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h
   code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BasicProjectile.cc
   code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/BallGun.cc
Log:
Projectiles survive infinitely

Modified: code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi	2019-05-16 12:27:40 UTC (rev 12377)
+++ code/branches/OrxoBlox_FS19/data/levels/includes/OrxoBloxWeapon.oxi	2019-05-16 12:53:00 UTC (rev 12378)
@@ -1,23 +1,17 @@
     <weaponslots>
-      <WeaponSlot position="-9.2,2,-13" />
-      <WeaponSlot position=" 9.2,2,-13" />
+      <WeaponSlot position="0,0,0" />/>
     </weaponslots>
     <weaponsets>
       <WeaponSet firemode=0 />
-      <WeaponSet firemode=1 />
     </weaponsets>
     <weaponpacks>
       <WeaponPack>
         <links>
           <DefaultWeaponmodeLink firemode=0 weaponmode=0 />
-          <DefaultWeaponmodeLink firemode=1 weaponmode=1 />
         </links>
         <Weapon>
           <BallGun mode=0 munitionpershot=0 delay=0.125 damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 0.1, 1.6,-2" projectileMesh="laserbeam.mesh" />
         </Weapon>
-        <Weapon>
-          <BallGun mode=0 munitionpershot=0 delay=0     damage=9.3 material="Flares/point_lensflare" muzzleoffset=" 1.6, 1.3, -2.0" projectileMesh="laserbeam.mesh" />
-        </Weapon>
       </WeaponPack>
       <WeaponPack>
         <links>

Modified: code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw
===================================================================
--- code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw	2019-05-16 12:27:40 UTC (rev 12377)
+++ code/branches/OrxoBlox_FS19/data/levels/orxoblox.oxw	2019-05-16 12:53:00 UTC (rev 12378)
@@ -54,6 +54,9 @@
         <Model position="0,0,0" mesh="CuboidBody.mesh" scale=4.5 />
         <Model position="0,0,0" mesh="cube_orange.mesh" scale=4.3 />
       </attached>
+      <collisionShapes>
+                <BoxCollisionShape position="0,0,0" halfExtents="4.5, 4.5, 4.5" />
+      </collisionShapes>
     </OrxoBloxStones>
   </Template>
   

Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc	2019-05-16 12:27:40 UTC (rev 12377)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.cc	2019-05-16 12:53:00 UTC (rev 12378)
@@ -103,11 +103,6 @@
         Vector3 velocity = this->getVelocity();
         Vector3 myPosition = otherObject->getPosition();
         btVector3 positionOtherObject = contactPoint.getPositionWorldOnA();
-        //orxout() << "About to Bounce >D" << endl;
-        //if (positionOtherObject.y < 0) {
-            //this.destroy()
-        //}S
-        //else {
         
             int distance_X = positionOtherObject.getX() - myPosition.x;
             int distance_Z = positionOtherObject.getZ() - myPosition.z;
@@ -142,16 +137,13 @@
     
     bool BallProjectile::processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs)
     {
-
-        //orxout() << "wanna bounce..." << endl;
         bool result = BasicProjectile::processCollision(otherObject, contactPoint, cs);
         if (result == true) {
             if (otherObject->isA(Class(OrxoBloxStones))) {
                 Bounce(otherObject, contactPoint, cs);
+                orxout() << "BOUNCED!" << endl;
             }
         }
-        //orxout() << "BOUNCED!" << endl;
-
         return result;
     }
 
@@ -288,5 +280,12 @@
         }
     }
 
+    void BallProjectile::destroyObject(void)
+    {
+        if(GameMode::isMaster()) {
+        }
+    }
 
+
+
 }

Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h	2019-05-16 12:27:40 UTC (rev 12377)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BallProjectile.h	2019-05-16 12:53:00 UTC (rev 12378)
@@ -64,7 +64,7 @@
             bool processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs) override;
 
         private:
-
+            void destroyObject() override;
             void registerVariables();
             void changeTexture();
             //OrxoBlox* getOrxoBlox();

Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BasicProjectile.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BasicProjectile.cc	2019-05-16 12:27:40 UTC (rev 12377)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/projectiles/BasicProjectile.cc	2019-05-16 12:53:00 UTC (rev 12378)
@@ -84,7 +84,6 @@
     */
     bool BasicProjectile::processCollision(WorldEntity* otherObject, btManifoldPoint& contactPoint, const btCollisionShape* cs)
     {
-        //orxout() << "OMG A COLLISION" << endl;
         if (!this->bDestroy_ && GameMode::isMaster())
         {
             if (this->isObjectRelatedToShooter(otherObject) || otherObject->isA(Class(BasicProjectile))) // Prevents you from shooting yourself or other projectiles
@@ -92,6 +91,7 @@
 
             if (getDestroyAfterCollision())
             {
+                orxout() << "Destroy that stuff" << endl;
                 this->bDestroy_ = true; // If something is hit, the object is destroyed and can't hit something else.
                                         // The projectile is destroyed by its tick()-function (in the following tick).
                                         // TODO: Use destroyLater() for this
@@ -172,8 +172,10 @@
     */
     void BasicProjectile::destroyCheck(void)
     {
-        if(GameMode::isMaster() && this->bDestroy_)
+        if(GameMode::isMaster() && this->bDestroy_) {
+            orxout() << "Set true, smhow" << endl;
             this->destroy();
+        }
     }
 
     /**
@@ -182,7 +184,9 @@
     */
     void BasicProjectile::destroyObject(void)
     {
-        if(GameMode::isMaster())
+        if(GameMode::isMaster()) {
+            orxout() << "Deleted myself" << endl;
             this->destroy();
+        }
     }
 }

Modified: code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/BallGun.cc
===================================================================
--- code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/BallGun.cc	2019-05-16 12:27:40 UTC (rev 12377)
+++ code/branches/OrxoBlox_FS19/src/modules/weapons/weaponmodes/BallGun.cc	2019-05-16 12:53:00 UTC (rev 12378)
@@ -59,7 +59,7 @@
 
         this->reloadTime_ = 0.25f;
         this->damage_ = 0.0f; //default 15
-        this->speed_ = 50;
+        this->speed_ = 100;
         this->delay_ = 100;
         this->setMunitionName("BallMunition");
         this->mesh_ = "laserbeam.mesh";
@@ -103,7 +103,6 @@
 
     void BallGun::fire()
     {
-        orxout() << "fire" << endl;
         this->delayTimer_.startTimer();
     }
 
@@ -114,7 +113,6 @@
     void BallGun::shot()
     {
         assert( this->getWeapon() && this->getWeapon()->getWeaponPack() && this->getWeapon()->getWeaponPack()->getWeaponSystem() && this->getWeapon()->getWeaponPack()->getWeaponSystem()->getPawn() );
-        orxout() << "SHOT!" << endl;
         // Create the projectile.
         Projectile* projectile = new BallProjectile(this->getContext());
         Model* model = new Model(projectile->getContext());



More information about the Orxonox-commit mailing list