Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10534 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Jan 31, 2007, 3:13:28 AM (18 years ago)
Author:
patrick
Message:

mounting weapon slots

Location:
trunk/src/world_entities
Files:
4 edited

Legend:

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

    r10529 r10534  
    186186      this->_mount->setParent( this);
    187187
    188       this->_mount->toList((OM_LIST)(this->getOMListNumber()));
     188      dynamic_cast<WorldEntity*>(this->_mount)->toList((OM_LIST)(this->getOMListNumber()));
    189189    }
    190190    else if( obj->isA( WeaponSlot::staticClassID()))
    191191    {
    192192      PRINTF(0)("=========+>we got a weapon slot\n");
     193
     194      // cast down the object to WE
     195      this->_mount = dynamic_cast<WeaponSlot*>(obj);
     196
     197      // now set the position, direction and reparent it to this node
     198      this->_mount->setAbsCoor( this->getAbsCoor());
     199      this->_mount->setAbsDir( this->getAbsDir());
     200      this->_mount->setParent( this);
    193201    }
    194202  }
     
    232240 * @param entity entity to be added
    233241 */
    234 void MountPoint::mount(WorldEntity* entity)
     242void MountPoint::mount(PNode* entity)
    235243{
    236244  this->_mount = entity;
  • trunk/src/world_entities/mount_point.h

    r10314 r10534  
    2929
    3030
    31     void mount(WorldEntity* entity);
     31    void mount(PNode* entity);
    3232    void unmount();
    3333
    3434
    3535  private:
    36     WorldEntity*         _mount;       //!< the entity mounted at this mount point
     36    PNode*               _mount;       //!< the entity mounted at this mount point
    3737    std::string          _name;        //!< the name of the mount point
    3838
  • trunk/src/world_entities/weapons/weapon_slot.cc

    r10440 r10534  
    2323
    2424ObjectListDefinition(WeaponSlot);
     25CREATE_FACTORY(WeaponSlot);
     26
    2527
    2628
     
    5153  LoadParam(root, "WeaponClass", this, WeaponSlot, setWeaponClass)
    5254  .describe("Sets the class this mount points should host");
     55
     56  LoadParam(root, "slot", this, WeaponSlot, setWeaponConfig)
     57      .describe("sets the weapon slot");
    5358}
    5459
  • trunk/src/world_entities/weapons/weapon_slot.h

    r10440 r10534  
    3636  inline void setNextWeapon(Weapon* weapon) { this->nextWeapon = weapon; }
    3737
     38
     39  inline void setWeaponConfig(int slot, int side) { this->weaponSlot = slot; this->weaponSide = side; }
     40  inline int getWeaponSlot() { return this->weaponSlot; }
     41  inline int getWeaponSide() { return this->weaponSide; }
     42
     43
    3844private:
     45
     46  int           weaponSlot;
     47  int           weaponSide;
    3948
    4049  long          capability;             //!< the capabilities of the Slot @see WeaponSlotCapability.
Note: See TracChangeset for help on using the changeset viewer.