Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

TurbineHover is cool now :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.