Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10542 in orxonox.OLD


Ignore:
Timestamp:
Jan 31, 2007, 5:15:54 AM (17 years ago)
Author:
patrick
Message:

slightly less debug. fixed segfault and better slot setting

Location:
trunk/src/world_entities
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/mount_point.cc

    r10540 r10542  
    140140  if( this->_mount != NULL)
    141141  {
    142     PRINTF(0)("Got detailed informations\n");
     142//     PRINTF(0)("Got detailed informations\n");
    143143    this->_mount->loadParams( root);
    144144
    145145    if( this->_mount->isA(ParticleSystem::staticClassID()))
    146146    {
    147       PRINTF(0)("got particle system. attaching it to mp\n");
     147//       PRINTF(0)("got particle system. attaching it to mp\n");
    148148      dynamic_cast<ParticleSystem*>(this->_mount)->attachEmmittersTo(this, Vector(0,0,0),
    149149                                    this->getRelDir()*Quaternion(M_PI, Vector(0,1,0)));
     
    177177    if( obj->isA( WorldEntity::staticClassID()))
    178178    {
    179       PRINTF(0)("Mount Point created a %s\n", obj->getCName());
     179//       PRINTF(0)("Mount Point created a %s\n", obj->getCName());
    180180      // cast down the object to WE
    181181      this->_mount = dynamic_cast<WorldEntity*>(obj);
     
    190190    else if( obj->isA( WeaponSlot::staticClassID()))
    191191    {
    192       PRINTF(0)("=========+>we got a weapon slot\n");
     192//       PRINTF(0)("=========+>we got a weapon slot\n");
    193193
    194194      // cast down the object to WE
  • trunk/src/world_entities/npcs/npc.cc

    r10540 r10542  
    173173  this->getWeaponManager().setSlotCount(7);
    174174
     175  this->getWeaponManager().setSlotPosition(0, Vector(-2.6, .1, -3.0));
     176  this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     177
     178  this->getWeaponManager().setSlotPosition(1, Vector(-2.6, .1, 3.0));
     179  this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     180
     181  this->getWeaponManager().setSlotPosition(2, Vector(-1.5, .5, -.5));
     182  this->getWeaponManager().setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
     183
     184  this->getWeaponManager().setSlotPosition(3, Vector(-1.5, .5, .5));
     185  this->getWeaponManager().setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
     186
     187  this->getWeaponManager().setSlotPosition(4, Vector(-1.5, -.5, .5));
     188  this->getWeaponManager().setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
     189
     190  this->getWeaponManager().setSlotPosition(5, Vector(-1.5, -.5, -.5));
     191  this->getWeaponManager().setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
     192
     193  this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0));
     194  this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     195
    175196
    176197  // now get slots from the mount points
    177 //   const std::vector<MountPoint*>::const_iterator it = this->beginMountPoints();
    178 //   std::vector<MountPoint*> list = this->getMountPoints();
    179198  std::map<int, MountPoint*>::iterator it = this->mountPointMap.begin();
    180 //   PRINTF(0)("\n\n\n\nsize: %i\n", this->mountPointMap.size());
    181199  for( ;it != this->mountPointMap.end(); it++)
    182200  {
    183     PRINTF(0)("5555555555 this npc got mountss\n\n\n");
    184201    WeaponSlot* ws = dynamic_cast<WeaponSlot*>((*it).second->getMount());
    185     printf("more\n");
    186202    if( ws != NULL && ws->isA(WeaponSlot::staticClassID()))
    187203    {
    188       //
    189       PRINTF(0)("5555555555 this npc got slots\n\n\n");
    190 
    191       this->getWeaponManager().setSlotPosition(ws->getWeaponSlot(), ws->getRelCoor());
    192       this->getWeaponManager().setSlotDirection(ws->getWeaponSlot(), ws->getRelDir());
     204      int slot = ws->getWeaponSlot();
     205      int side = ws->getWeaponSide();
     206      this->getWeaponManager().setSlotPosition(slot, ws->getRelCoor());
     207      this->getWeaponManager().setSlotDirection(slot, ws->getRelDir());
     208      PRINTF(0)("setting slot %i\n", slot);
    193209    }
    194210  }
    195 
    196 
    197 
    198   this->getWeaponManager().setSlotPosition(0, Vector(-2.6, .1, -3.0));
    199   this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    200 
    201   this->getWeaponManager().setSlotPosition(1, Vector(-2.6, .1, 3.0));
    202   this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    203 
    204   this->getWeaponManager().setSlotPosition(2, Vector(-1.5, .5, -.5));
    205   this->getWeaponManager().setSlotDirection(2, Quaternion(-M_PI_4*.5, Vector(1,0,0)));
    206 
    207   this->getWeaponManager().setSlotPosition(3, Vector(-1.5, .5, .5));
    208   this->getWeaponManager().setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
    209 
    210   this->getWeaponManager().setSlotPosition(4, Vector(-1.5, -.5, .5));
    211   this->getWeaponManager().setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
    212 
    213   this->getWeaponManager().setSlotPosition(5, Vector(-1.5, -.5, -.5));
    214   this->getWeaponManager().setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
    215 
    216   this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0));
    217   this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    218211
    219212  this->getWeaponManager().getFixedTarget()->setParent(this);
    220213  this->getWeaponManager().getFixedTarget()->setRelCoor(100000,0,0);
    221 
    222 
    223 
    224 
    225214}
    226215
Note: See TracChangeset for help on using the changeset viewer.