Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7001 in orxonox.OLD


Ignore:
Timestamp:
Feb 3, 2006, 2:18:26 AM (18 years ago)
Author:
bensch
Message:

TurbineHover is cool now :)

Location:
trunk/src/world_entities/space_ships
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/space_ships/space_ship.cc

    r6997 r7001  
    287287  Playable::collidesWith(entity, location);
    288288
    289 
    290   if (entity->isA(CL_TURRET_POWER_UP) && entity != ref)
    291   {
    292     this->ADDWEAPON();
    293     ref = entity;
    294   }
    295 
    296289  if( entity->isA(CL_PROJECTILE) && entity != ref)
    297290  {
     
    501494}
    502495
    503 #include "weapons/aiming_turret.h"
    504 // FIXME THIS MIGHT BE CONSIDERED EITHER A FEATURE, OR A BUG
    505 void SpaceShip::ADDWEAPON()
    506 {
    507   Weapon* turret = NULL;
    508 
    509   if ((float)rand()/RAND_MAX < .9)
    510   {
    511     //if (this->getWeaponManager()->hasFreeSlot(2, WTYPE_TURRET))
    512     {
    513       turret = new Turret();
    514       this->addWeapon(turret, 2);
    515       this->getWeaponManager()->changeWeaponConfig(2);
    516     }
    517   }
    518   else
    519   {
    520     //if (this->getWeaponManager()->hasFreeSlot(3))
    521     {
    522       turret = dynamic_cast<Weapon*>(Factory::fabricate(CL_TARGETING_TURRET));
    523       if (turret != NULL)
    524       this->addWeapon(turret, 3);
    525 
    526       this->getWeaponManager()->changeWeaponConfig(3);
    527     }
    528   }
    529 
    530   if(turret != NULL)
    531   {
    532     turret->setName("Turret");
    533     turret->setStateDuration(WS_SHOOTING, (float)rand()/RAND_MAX*.5+.1);
    534   }
    535 }
    536496
    537497#define MASK_bUp         1
  • trunk/src/world_entities/space_ships/space_ship.h

    r6959 r7001  
    4949    void doCollideNetwork( float energy );
    5050
    51     // !! temporary !!
    52     void ADDWEAPON();
    53 
    5451    bool                  bUp;                //!< up button pressed.
    5552    bool                  bDown;              //!< down button pressed.
  • trunk/src/world_entities/space_ships/turbine_hover.cc

    r7000 r7001  
    3030
    3131#include "graphics_engine.h"
     32#include "dot_emitter.h"
     33#include "sprite_particles.h"
    3234
    3335using namespace std;
     
    112114  this->cameraLook = 0.0f;
    113115  this->rotation = 0.0f;
    114   this->acceleration = 25.0f;
    115   this->airFriction = 3.0f;
     116  this->acceleration = 10.0f;
     117  this->airFriction = 2.0f;
    116118
    117119  // camera - issue
     
    138140  this->rotorNodeRight.setRelCoor(0, 1.0, 2.3);
    139141
    140   dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
     142  // PARTICLES
     143  this->burstEmitter[0] = new DotEmitter(200, 5.0, .01);
     144  this->burstEmitter[0]->setParent(&this->rotorNodeLeft);
     145  this->burstEmitter[0]->setRelCoor(0, -0.7, 0);
     146  this->burstEmitter[0]->setRelDir(Quaternion(-M_PI_2, Vector(0,0,1)));
     147  this->burstEmitter[0]->setName("TurbineHover_Burst_emitter_Left");
     148
     149  this->burstEmitter[1] = new DotEmitter(200, 5.0, .01);
     150  this->burstEmitter[1]->setParent(&this->rotorNodeRight);
     151  this->burstEmitter[1]->setRelCoor(0, -0.7, 0);
     152  this->burstEmitter[1]->setRelDir(Quaternion(-M_PI_2, Vector(0,0,1)));
     153  this->burstEmitter[1]->setName("TurbineHover_Burst_emitter_Right");
     154
     155
     156  this->burstSystem = new SpriteParticles(1000);
     157  this->burstSystem->addEmitter(this->burstEmitter[0]);
     158  this->burstSystem->addEmitter(this->burstEmitter[1]);
     159  this->burstSystem->setName("SpaceShip_Burst_System");
     160  ((SpriteParticles*)this->burstSystem)->setMaterialTexture("maps/radial-trans-noise.png");
     161  this->burstSystem->setLifeSpan(1.0, .3);
     162  this->burstSystem->setRadius(0.0, 1.5);
     163  this->burstSystem->setRadius(0.05, 1.8);
     164  this->burstSystem->setRadius(.5, .8);
     165  this->burstSystem->setRadius(1.0, 0);
     166  this->burstSystem->setColor(0.0, .7,.7,1,.5);
     167  this->burstSystem->setColor(0.2, 0,0,0.8,.5);
     168  this->burstSystem->setColor(0.5, .5,.5,.8,.3);
     169  this->burstSystem->setColor(1.0, .8,.8,.8,.0);
    141170
    142171
     
    153182  registerEvent(EV_MOUSE_MOTION);
    154183
     184  dynamic_cast<Element2D*>(this->getWeaponManager()->getFixedTarget())->setVisibility( false);
    155185
    156186  // WEAPON_MANAGER configuration
     
    241271  this->movement(dt);
    242272  this->rotorCycle += this->rotorSpeed * dt;
     273
     274  // TRYING TO FIX PNode.
     275/*  this->cameraNode.setAbsCoorSoft(this->getAbsCoor() + Vector(0,5,0), 30);
     276  this->cameraNode.setAbsDirSoft(this->getAbsDir(), 30);*/
    243277}
    244278
     
    293327  this->setRelDirSoft(this->direction * Quaternion(-cameraLook, Vector(0,0,1)), 5);
    294328
    295   this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .03 +this->rotation, Vector(1,0,0)), 5);
    296   this->rotorNodeLeft.setRelDirSoft(Quaternion(-accel.x * .05+this->rotation + cameraLook, Vector(0,0,1)), 5);
    297 
    298   this->wingNodeRight.setRelDirSoft(Quaternion(accel.z * .03 +this->rotation, Vector(1,0,0)), 5);
    299   this->rotorNodeRight.setRelDirSoft(Quaternion(-accel.x*.05 -this->rotation + cameraLook, Vector(0,0,1)), 5);
     329  this->wingNodeLeft.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5);
     330  this->rotorNodeLeft.setRelDirSoft(Quaternion(-accel.x * .07+this->rotation + cameraLook, Vector(0,0,1)), 5);
     331
     332  this->wingNodeRight.setRelDirSoft(Quaternion(accel.z * .05 +this->rotation, Vector(1,0,0)), 5);
     333  this->rotorNodeRight.setRelDirSoft(Quaternion(-accel.x*.07 -this->rotation + cameraLook, Vector(0,0,1)), 5);
    300334}
    301335
  • trunk/src/world_entities/space_ships/turbine_hover.h

    r7000 r7001  
    99
    1010#include "playable.h"
     11
     12// Forward Declaration
     13class ParticleEmitter;
     14class ParticleSystem;
    1115
    1216class TurbineHover : public Playable
     
    6771    float                 airViscosity;
    6872
     73    ParticleEmitter*      burstEmitter[2];
     74    ParticleSystem*       burstSystem;
    6975};
    7076
Note: See TracChangeset for help on using the changeset viewer.