Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8776 in orxonox.OLD for trunk/src/world_entities/creatures


Ignore:
Timestamp:
Jun 25, 2006, 11:47:54 PM (19 years ago)
Author:
patrick
Message:

trunk: added weapons to the fps character

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/creatures/fps_player.cc

    r8731 r8776  
    2222#include "src/lib/util/loading/factory.h"
    2323
     24#include "weapons/weapon_manager.h"
     25#include "weapons/test_gun.h"
     26#include "weapons/turret.h"
     27#include "weapons/cannon.h"
     28
    2429#include "key_mapper.h"
    2530
     
    6368  this->setClassID(CL_FPS_PLAYER, "FPSPlayer");
    6469
    65   this->getWeaponManager().changeWeaponConfig(1);
    6670
    6771  this->bLeft = false;
     
    9296  registerEvent(EV_MOUSE_MOTION);
    9397
    94   this->getWeaponManager().setSlotCount(0);
    95 
    96 
     98
     99
     100  // weapon manager for the fps
    97101  dynamic_cast<Element2D*>(this->getWeaponManager().getFixedTarget())->setVisibility( false);
     102
     103  Weapon* wpRight = new TestGun(0);
     104  wpRight->setName("testGun Right");
     105  Weapon* wpLeft = new TestGun(1);
     106//   Weapon* wpLeft = new Turret();
     107  wpLeft->setName("testGun Left");
     108
     109  this->addWeapon(wpLeft, 1, 0);
     110  this->addWeapon(wpRight,1 ,1);
     111  this->getWeaponManager().changeWeaponConfig(1);
     112
     113  this->getWeaponManager().setSlotCount(2);
     114  this->getWeaponManager().setSlotPosition(0, Vector(-0.5, .2, -1.9));
     115  this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     116  this->getWeaponManager().setSlotPosition(1, Vector(-0.5, .2, 1.9));
     117  this->getWeaponManager().setSlotDirection(1, Quaternion(M_PI_4*.5, Vector(1,0,0)));
     118
     119  this->getWeaponManager().getFixedTarget()->setParent(&this->cameraNode);
     120  this->getWeaponManager().getFixedTarget()->setRelCoor(1000,0,0);
     121
    98122
    99123  // network registration
     
    103127  registerVar( new SynchronizeableBool( &bBackward, &bBackward, "bBackward", PERMISSION_OWNER ) );
    104128//  registerVar( new SynchronizeableQuaternion( &mouseDir, &mouseDir, "mouseDir", PERMISSION_OWNER ) );
     129
    105130
    106131  // collision reaction registration
Note: See TracChangeset for help on using the changeset viewer.