Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10540 in orxonox.OLD for trunk/src/world_entities/npcs


Ignore:
Timestamp:
Jan 31, 2007, 5:04:11 AM (18 years ago)
Author:
patrick
Message:

mounting point rewritten partially, for weapon slots

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/npcs/npc.cc

    r10539 r10540  
    5252#include "weapons/turret.h"
    5353#include "weapons/cannon.h"
     54
     55#include "mount_point.h"
     56#include "weapons/weapon_slot.h"
    5457
    5558#include "npc.h"
     
    169172
    170173  this->getWeaponManager().setSlotCount(7);
     174
     175
     176  // now get slots from the mount points
     177//   const std::vector<MountPoint*>::const_iterator it = this->beginMountPoints();
     178//   std::vector<MountPoint*> list = this->getMountPoints();
     179  std::map<int, MountPoint*>::iterator it = this->mountPointMap.begin();
     180//   PRINTF(0)("\n\n\n\nsize: %i\n", this->mountPointMap.size());
     181  for( ;it != this->mountPointMap.end(); it++)
     182  {
     183    PRINTF(0)("5555555555 this npc got mountss\n\n\n");
     184    WeaponSlot* ws = dynamic_cast<WeaponSlot*>((*it).second->getMount());
     185    printf("more\n");
     186    if( ws != NULL && ws->isA(WeaponSlot::staticClassID()))
     187    {
     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());
     193    }
     194  }
     195
     196
    171197
    172198  this->getWeaponManager().setSlotPosition(0, Vector(-2.6, .1, -3.0));
Note: See TracChangeset for help on using the changeset viewer.