Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10740 in orxonox.OLD for branches/presentation/src


Ignore:
Timestamp:
Jun 20, 2007, 8:00:41 PM (17 years ago)
Author:
rennerc
Message:

less collision hacks

Location:
branches/presentation/src/world_entities
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/projectiles/acid_splash.cc

    r10701 r10740  
    2424#include <cassert>
    2525#include "debug.h"
     26
     27#include "obb_tree.h"
    2628
    2729#include "effects/wobblegrid.h"
     
    6971
    7072  this->grid->toList(OM_ENVIRON);
     73 
     74  this->obbTree = new OBBTree();
     75  this->obbTree->createBox(Vector(0.0f, 0.0f, 0.0f), Vector(1.0f, 1.0f, 1.0f));
     76  this->setOBBTree(this->obbTree);
    7177}
    7278
     
    125131
    126132  this->grid->tick(dt);
    127 
    128   for( ObjectList<Playable>::const_iterator eIterator = Playable::objectList().begin(); eIterator !=Playable::objectList().end(); eIterator++)
    129   {
    130     if( ((*eIterator)->getOMListNumber() != (this->origList -1))  && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)
    131     {
    132       (*eIterator)->hit (this->getDamage(),this);
    133       this->deactivate();
    134     }
    135   }
    136 
    137133}
    138134
  • branches/presentation/src/world_entities/projectiles/acid_splash.h

    r10368 r10740  
    4141
    4242    WorldEntity* hitEntity; // FIXME TEMPORARY
     43    OBBTree*                    obbTree;
    4344};
    4445
  • branches/presentation/src/world_entities/projectiles/hbolt.cc

    r10739 r10740  
    2929#include <cassert>
    3030#include "debug.h"
     31
     32#include "obb_tree.h"
    3133
    3234// #include "effects/billboard.h"
     
    6365  this->halo->setTexture("hbolt_halo2.png");
    6466  this->halo->setVisibility(false);
     67 
     68  this->obbTree = new OBBTree();
     69  this->obbTree->createBox(Vector(0.0f, 0.0f, 0.0f), Vector(1.0f, 1.0f, 1.0f));
     70  this->setOBBTree(this->obbTree);
    6571
    6672}
     
    149155
    150156  this->angle += HBolt::rotationSpeed * dt;
    151 
    152   for( ObjectList<ActionboxEnemy>::const_iterator eIterator = ActionboxEnemy::objectList().begin(); eIterator !=ActionboxEnemy::objectList().end(); eIterator++)
    153   {
    154     if( ((*eIterator)->getOMListNumber() != (this->origList -1))  && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)
    155     {
    156       (*eIterator)->destroy(this); //hit (this->getDamage(),this);
    157       this->deactivate();
    158   PRINTF(0)("HBolt destroyed\n");
    159     }
    160   }
    161157}
    162158
  • branches/presentation/src/world_entities/projectiles/hbolt.h

    r10737 r10740  
    4848
    4949    WorldEntity* hitEntity; // FIXME TEMPORARY
     50    OBBTree*                    obbTree;
    5051};
    5152
  • branches/presentation/src/world_entities/projectiles/lbolt.cc

    r10698 r10740  
    3131#include <cassert>
    3232#include "debug.h"
     33
     34#include "obb_tree.h"
    3335
    3436#include "space_ships/space_ship.h"
     
    6769  this->halo->setPulse();
    6870
     71   
     72  this->obbTree = new OBBTree();
     73  this->obbTree->createBox(Vector(0.0f, 0.0f, 0.0f), Vector(1.0f, 1.0f, 1.0f));
     74  this->setOBBTree(this->obbTree);
    6975}
    7076
     
    151157  if(angle > 360)
    152158    angle -= 360;
    153 
    154   for( ObjectList<NPC>::const_iterator eIterator = NPC::objectList().begin(); eIterator !=NPC::objectList().end(); eIterator++)
    155   {
    156     if( ((*eIterator)->getOMListNumber() != (this->origList -1))  && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)
    157     {
    158       (*eIterator)->destroy(this); //hit (this->getDamage(),this);
    159       this->deactivate();
    160   PRINTF(0)("LBolt destroyed\n");
    161     }
    162   }
    163159}
    164160
  • branches/presentation/src/world_entities/projectiles/lbolt.h

    r10618 r10740  
    4848
    4949    WorldEntity* hitEntity; // FIXME TEMPORARY
     50    OBBTree*                    obbTree;
    5051};
    5152
  • branches/presentation/src/world_entities/projectiles/mbolt.cc

    r10698 r10740  
    3636
    3737#include "effects/trail.h"
     38
     39#include "obb_tree.h"
    3840
    3941
     
    8486//   this->trail->setAbsCoor(this->getAbsCoor() - Vector(.7,0,0));
    8587  this->trail->setAbsCoor(this->getAbsCoor() - this->getVelocity().getNormalized() * .7);
     88 
     89  this->obbTree = new OBBTree();
     90  this->obbTree->createBox(Vector(0.0f, 0.0f, 0.0f), Vector(1.0f, 1.0f, 1.0f));
     91  this->setOBBTree(this->obbTree);
    8692
    8793}
     
    178184  this->angle += MBolt::rotationSpeed * dt;
    179185  this->trail->tick(dt);
    180 
    181   for( ObjectList<NPC>::const_iterator eIterator = NPC::objectList().begin(); eIterator !=NPC::objectList().end(); eIterator++)
    182   {
    183     if( ((*eIterator)->getOMListNumber() != (this->origList -1))  && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)
    184     {
    185       (*eIterator)->destroy(this); //hit (this->getDamage(),this);
    186       this->deactivate();
    187       PRINTF(0)("MBolt destroyed\n");
    188     }
    189   }
    190186}
    191187
  • branches/presentation/src/world_entities/projectiles/mbolt.h

    r10368 r10740  
    5050
    5151    WorldEntity* hitEntity; // FIXME TEMPORARY
     52    OBBTree*                    obbTree;
    5253};
    5354
  • branches/presentation/src/world_entities/projectiles/nadion_blast.cc

    r10737 r10740  
    180180  this->angle += NadionBlast::rotationSpeed * dt;
    181181//   this->trail->tick(dt);
    182 
    183   for( ObjectList<ActionboxEnemy>::const_iterator eIterator = ActionboxEnemy::objectList().begin(); eIterator !=ActionboxEnemy::objectList().end(); eIterator++)
    184   {
    185     if( ((*eIterator)->getOMListNumber() != (this->origList -1))  && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 8)
    186     {
    187       (*eIterator)->destroy(this); //hit (this->getDamage(),this);
    188       this->deactivate();
    189       PRINTF(0)("NadionBlast destroyed\n");
    190     }
    191   }
    192182}
    193183
  • branches/presentation/src/world_entities/projectiles/plasma_pulse.cc

    r10739 r10740  
    2525#include <cassert>
    2626#include "debug.h"
     27
     28#include "obb_tree.h"
    2729
    2830
     
    5961  this->blink->loadBlinkSequence( "66678998766" );
    6062  this->blink->toList(OM_ENVIRON);*/
     63 
     64  this->obbTree = new OBBTree();
     65  this->obbTree->createBox(Vector(0.0f, 0.0f, 0.0f), Vector(1.0f, 1.0f, 1.0f));
     66  this->setOBBTree(this->obbTree);
    6167}
    6268
     
    112118
    113119  this->grid->tick(dt);
    114 
    115   for( ObjectList<ActionboxEnemy>::const_iterator eIterator = ActionboxEnemy::objectList().begin(); eIterator !=ActionboxEnemy::objectList().end(); eIterator++)
    116   {
    117     if( ((*eIterator)->getOMListNumber() != (this->origList -1))  && ((*eIterator)->getAbsCoor() - this->getAbsCoor()).len() <= 3)
    118     {
    119       (*eIterator)->hit (this->getDamage(),this);
    120       this->deactivate();
    121     }
    122   }
    123 
    124120}
    125121
  • branches/presentation/src/world_entities/projectiles/plasma_pulse.h

    r10698 r10740  
    3434    static FastFactory*               fastFactory;
    3535    Billboard*                        grid;
     36    OBBTree*                    obbTree;
    3637//     Blink*                            blink;
    3738};
  • branches/presentation/src/world_entities/space_ships/space_ship.cc

    r10739 r10740  
    178178
    179179
    180  /* this->weaponMan.addWeaponToSlot(0, 0, "RFCannon");
     180  this->weaponMan.addWeaponToSlot(0, 0, "RFCannon");
    181181  this->weaponMan.addWeaponToSlot(0, 1, "RFCannon");
    182182  this->weaponMan.addWeaponToSlot(0, 2, "RFCannon");
     
    185185  this->weaponMan.addWeaponToSlot(1, 1, "RFCannon");
    186186  this->weaponMan.addWeaponToSlot(1, 2, "RFCannon");
    187   this->weaponMan.addWeaponToSlot(1, 3, "RFCannon");*/
     187  this->weaponMan.addWeaponToSlot(1, 3, "RFCannon");
    188188
    189189/*  this->weaponMan.addWeaponToSlot(0, 4, "NadionLaser");
    190190  this->weaponMan.addWeaponToSlot(0, 5, "NadionLaser");
    191191  this->weaponMan.addWeaponToSlot(2, 4, "NadionLaser");
    192   this->weaponMan.addWeaponToSlot(2, 5, "NadionLaser");*/
     192  this->weaponMan.addWeaponToSlot(2, 5, "NadionLaser");
    193193
    194194  this->weaponMan.addWeaponToSlot(0, 6, "Disruptor");
    195195  this->weaponMan.addWeaponToSlot(0, 7, "Disruptor");
    196196  this->weaponMan.addWeaponToSlot(3, 6, "Disruptor");
    197   this->weaponMan.addWeaponToSlot(3, 7, "Disruptor");
     197  this->weaponMan.addWeaponToSlot(3, 7, "Disruptor");*/
    198198
    199199
Note: See TracChangeset for help on using the changeset viewer.