Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 4, 2006, 5:38:24 PM (18 years ago)
Author:
bensch
Message:

added laser-cannon

File:
1 edited

Legend:

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

    r9149 r9159  
    9191
    9292  //weapons:
    93   Weapon* wpRight = new TestGun(0);
     93  Weapon* wpRight = dynamic_cast<Weapon*>(Factory::fabricate(CL_LASER_CANNON));
    9494  wpRight->setName("testGun Right");
    95   Weapon* wpLeft = new TestGun(1);
     95  Weapon* wpLeft = dynamic_cast<Weapon*>(Factory::fabricate(CL_LASER_CANNON));
    9696  wpLeft->setName("testGun Left");
    9797  //Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_HYPERBLASTER));
     
    123123  this->cameraLook = 0.0f;
    124124  this->rotation = 0.0f;
    125   this->acceleration = 10.0f;
     125  this->acceleration = 20.0f;
    126126  this->airFriction = 0.0f;
    127127
     
    136136  this->travelNode = new PNode();
    137137
     138  this->loadModel("models/ships/mantawing.obj", 5.0f);
    138139
    139140  // camera - issue
     
    180181  this->getWeaponManager().setSlotCount(5);
    181182
    182   this->getWeaponManager().setSlotPosition(0, Vector(-0.28, 1.186, -2.750));
     183  this->getWeaponManager().setSlotPosition(0, Vector(1.843, -0.335, 2.029) * 5.0);
    183184  this->getWeaponManager().setSlotCapability(0, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    184185
    185   this->getWeaponManager().setSlotPosition(1, Vector(-0.28, 1.186, 2.750));
     186  this->getWeaponManager().setSlotPosition(1, Vector(1.843, -0.335, -2.029) * 5.0);
    186187  this->getWeaponManager().setSlotCapability(1, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    187188
     
    207208  registerVar( new SynchronizeableFloat( &cameraLook, &cameraLook, "cameraLook", PERMISSION_OWNER ) );
    208209  registerVar( new SynchronizeableFloat( &rotation, &rotation, "rotation", PERMISSION_OWNER ) );
     210
     211
     212
    209213}
    210214
     
    454458        this->velocity += (accelerationDir - damping)* dt;
    455459
    456         if (this->getRelCoor().z > this->travelDistance.y && accel.z > 0.0)
     460        if (this->getRelCoor().z > this->travelDistance.y && velocity.z > 0.0)
    457461          this->velocity.z = 0.0f;
    458         if (this->getRelCoor().z < -this->travelDistance.y && accel.z < 0.0)
     462        if (this->getRelCoor().z < -this->travelDistance.y && velocity.z < 0.0)
    459463          this->velocity.z = 0.0f;
    460464
    461         if (this->getRelCoor().x > this->travelDistance.x && accel.x > 0.0)
     465        if (this->getRelCoor().x > this->travelDistance.x && velocity.x > 0.0)
    462466          this->velocity.x = 0.0f;
    463         if (this->getRelCoor().x < -this->travelDistance.x && accel.x < 0.0)
     467        if (this->getRelCoor().x < -this->travelDistance.x && velocity.x < 0.0)
    464468          this->velocity.x = 0.0f;
    465469
     
    467471        this->shiftCoor (this->velocity * dt);
    468472        if (accel.z == 0)
    469           this->setRelDirSoft(Quaternion(0, Vector(0,0,0)), 3.0f);
     473          this->setRelDirSoft(Quaternion(0, Vector(0,0,0)), 5.0f);
    470474        else
    471           this->setRelDirSoft(Quaternion(this->velocity.z * .01, Vector(1,0,0)), 2.0f);
     475          this->setRelDirSoft(Quaternion(this->velocity.z * .004, Vector(1,0,0)), 4.5f);
    472476      }
    473477      break;
Note: See TracChangeset for help on using the changeset viewer.