Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10719 in orxonox.OLD


Ignore:
Timestamp:
Jun 18, 2007, 6:02:47 PM (17 years ago)
Author:
nicolasc
Message:

crosshair moves, shot do too, but not exactly where they should

Location:
branches/presentation/src/world_entities
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/presentation/src/world_entities/space_ships/space_ship.cc

    r10715 r10719  
    9292                        ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY))
    9393                        ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
    94                         //->addMethod("setCameraSpeed", Executor1<SpaceShip, lua_State*, float>(&SpaceShip::setCameraSpeed))
     94                        //->addMethod("setCameraSpeed", Executor1<SpVector(1,0,0)aceShip, lua_State*, float>(&SpaceShip::setCameraSpeed))
    9595                        ->addMethod("pause", Executor1<WorldEntity, lua_State*, bool>(&WorldEntity::pauseTrack))
    9696                        ->addMethod("setCameraDist", Executor1<SpaceShip, lua_State*, float>(&SpaceShip::setCameraDistance))
     
    592592    this->yMouse += event.yRel;
    593593//     printf("Mouse Coord: %f, %f\n", this->xMouse, this->yMouse);
    594     this->weaponMan.getFixedTarget()->setRelCoor(10000, -10 * this->mouseSensitivity * yMouse, 10 * this->mouseSensitivity * xMouse);
    595     this->secWeaponMan.getFixedTarget()->setRelCoor(10000, -10 * this->mouseSensitivity * yMouse, 10 * this->mouseSensitivity * xMouse);
     594    this->weaponMan.getFixedTarget()->setRelCoor(100000, -100 * this->mouseSensitivity * yMouse, 100 * this->mouseSensitivity * xMouse);
     595    this->secWeaponMan.getFixedTarget()->setRelCoor(100000, -100 * this->mouseSensitivity * yMouse, 100 * this->mouseSensitivity * xMouse);
    596596  }
    597597  else if (!(State::getCamera()->getEventHandling()))
  • branches/presentation/src/world_entities/space_ships/space_ship.h

    r10715 r10719  
    7575    inline void loadWeapon(float regen) { this->weaponEnergyRegen = regen; };
    7676
    77     void addWeaponToSlot(int wm, int config, int slot, const std::string& weaponName);
     77//     void addWeaponToSlot(int wm, int config, int slot, const std::string& weaponName);
    7878
    7979    inline PNode* getTravelNode() { return this->travelNode; };
  • branches/presentation/src/world_entities/weapons/disruptor.cc

    r10702 r10719  
    153153  pj->setParent(PNode::getNullParent());
    154154
    155   pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*130 + VECTOR_RAND(1));
     155  Vector tmp = this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor();
     156
     157//   pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*130 + VECTOR_RAND(1));
     158  pj->setVelocity(this->getAbsDir().apply(tmp.getNormalized())*130 + VECTOR_RAND(1));
    156159
    157160  pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor());
    158   pj->setAbsDir(this->getAbsDir());
     161//   pj->setAbsDir(this->getAbsDir());
    159162  pj->activate();
    160163
  • branches/presentation/src/world_entities/weapons/nadion_laser.cc

    r10702 r10719  
    142142  pj->setParent(PNode::getNullParent());
    143143
    144   pj->setVelocity(this->getParent()->getVelocity() + this->getAbsDir().apply(Vector(1,0,0))*160);
     144  Vector tmp = this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor();
     145
     146  pj->setVelocity(this->getParent()->getVelocity() + this->getAbsDir().apply(tmp.getNormalized())*160);
    145147
    146148  pj->setAbsCoor(this->getEmissionPoint());
    147   pj->setAbsDir(this->getAbsDir());
     149//   pj->setAbsDir(this->getAbsDir());
    148150  pj->activate();
    149151
  • branches/presentation/src/world_entities/weapons/rf_cannon.cc

    r10715 r10719  
    135135  pj->setParent(PNode::getNullParent());
    136136
    137   pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*190);
     137//   pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*190);
     138  Vector tmp = this->getDefaultTarget()->getAbsCoor() - this->getAbsCoor();
     139
     140  pj->setVelocity(this->getParent()->getVelocity() + this->getAbsDir().apply(tmp.getNormalized())*190);
    138141
    139142  pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor());
    140   pj->setAbsDir(this->getAbsDir());
    141 //   pj->setAbsDir(Quaternion(0, dynamic_cast<WeaponManager*>(this->getParent())->getFixedTarget()->getAbsCoor() - this->getParent()->getAbsCoor()));
    142 //   pj->setAbsDir(dynamic_cast<WeaponManager*>(this->getParent())->getFixedTarget()->getAbsDir());
     143//   pj->setAbsDir(this->getAbsDir());
     144
    143145  pj->activate();
    144146
  • branches/presentation/src/world_entities/weapons/weapon_manager.h

    r10714 r10719  
    8686
    8787    inline void addWeaponToSlot(int config, int slot, const std::string& weaponName){
    88       this->addWeapon( Weapon::createWeapon( weaponName ), config, slot); };
     88      this->addWeapon( Weapon::createWeapon( weaponName ), config, slot); this->configs[config][slot]->setDefaultTarget(this->getFixedTarget()); };
    8989
    9090
Note: See TracChangeset for help on using the changeset viewer.