Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8776 in orxonox.OLD


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

trunk: added weapons to the fps character

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/collision_detection/obb_tree_node.cc

    r8316 r8776  
    676676
    677677  /* draw world axes */
    678   if( 1 /*drawMode & DRAW_BV_AXIS*/)
    679   {
    680     glBegin(GL_LINES);
    681     glColor3f(1.0, 0.0, 0.0);
    682     glVertex3f(0.0, 0.0, 0.0);
    683     glVertex3f(3.0, 0.0, 0.0);
    684 
    685     glColor3f(0.0, 1.0, 0.0);
    686     glVertex3f(0.0, 0.0, 0.0);
    687     glVertex3f(0.0, 3.0, 0.0);
    688 
    689     glColor3f(0.0, 0.0, 1.0);
    690     glVertex3f(0.0, 0.0, 0.0);
    691     glVertex3f(0.0, 0.0, 3.0);
    692     glEnd();
    693   }
     678//   if( 1 /*drawMode & DRAW_BV_AXIS*/)
     679//   {
     680//     glBegin(GL_LINES);
     681//     glColor3f(1.0, 0.0, 0.0);
     682//     glVertex3f(0.0, 0.0, 0.0);
     683//     glVertex3f(3.0, 0.0, 0.0);
     684//
     685//     glColor3f(0.0, 1.0, 0.0);
     686//     glVertex3f(0.0, 0.0, 0.0);
     687//     glVertex3f(0.0, 3.0, 0.0);
     688//
     689//     glColor3f(0.0, 0.0, 1.0);
     690//     glVertex3f(0.0, 0.0, 0.0);
     691//     glVertex3f(0.0, 0.0, 3.0);
     692//     glEnd();
     693//   }
    694694
    695695
  • 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.