Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10549 in orxonox.OLD


Ignore:
Timestamp:
Jan 31, 2007, 6:30:06 AM (17 years ago)
Author:
patrick
Message:

more on mounting weapons

Location:
trunk/src/world_entities
Files:
3 edited

Legend:

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

    r10546 r10549  
    4444  this->setRelCoor( center);
    4545  this->setRelDir( Quaternion(forward, up));
     46
     47  this->_center = center;
     48  this->_up = up;
     49  this->_forward = forward;
    4650
    4751  this->init();
     
    191195    {
    192196      PRINTF(0)("=========+>we got a weapon slot at\n");
    193       this->getRelCoor().debug();
     197      this->getAbsCoor().debug();
     198      this->_center.debug();
    194199
    195200
     
    198203
    199204      // now set the position, direction and reparent it to this node
    200       this->_mount->setRelCoor( this->getRelCoor());
    201       this->_mount->setRelDir( this->getRelDir());
     205      this->_mount->setAbsCoor( this->_center);
     206      this->_mount->setAbsDir( this->getAbsDir());
    202207      this->_mount->setParent( this);
    203208    }
  • trunk/src/world_entities/mount_point.h

    r10540 r10549  
    2828    void debugDraw() const;
    2929
     30    inline const Vector& getCenter() { return this->_center; }
    3031
    3132    void mount(PNode* entity);
     
    3940    std::string          _description; //!< string containing an optional description
    4041
     42    Vector               _center;
     43    Vector               _up;
     44    Vector               _forward;
     45
    4146};
    4247
  • trunk/src/world_entities/npcs/npc.cc

    r10546 r10549  
    304304  this->setAI( false);
    305305  this->setAbsCoor(-10000,-10000,-10000);
    306  
     306
    307307
    308308}
     
    409409        int slot = ws->getWeaponSlot();
    410410        int side = ws->getWeaponSide();
    411         this->getWeaponManager().setSlotPosition(slot, ws->getRelCoor());
     411        this->getWeaponManager().setSlotPosition(slot, (*it).second->getCenter());
    412412        this->getWeaponManager().setSlotDirection(slot, ws->getRelDir());
    413413        PRINTF(0)("setting slot %i\n", slot);
    414         ws->getRelCoor().debug();
     414        (*it).second->getCenter().debug();
    415415      }
    416416    }
Note: See TracChangeset for help on using the changeset viewer.