Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9869 in orxonox.OLD for trunk/src/world_entities/space_ships


Ignore:
Timestamp:
Oct 3, 2006, 12:19:30 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the new_class_id branche back to the trunk.
merged with command:
svn merge https://svn.orxonox.net/orxonox/branches/new_class_id trunk -r9683:HEAD
no conflicts… puh..

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

Legend:

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

    r9406 r9869  
    2424
    2525
     26#include "class_id_DEPRECATED.h"
     27ObjectListDefinitionID(CollisionProbe, CL_COLLISION_PROBE);
    2628
    27 
    28 CREATE_FACTORY(CollisionProbe, CL_COLLISION_PROBE);
     29CREATE_FACTORY(CollisionProbe);
    2930
    3031
     
    5657void CollisionProbe::init()
    5758{
    58   this->setClassID(CL_COLLISION_PROBE, "CollisionProbe");
     59  this->registerObject(this, CollisionProbe::_objectList);
    5960
    6061  bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false;
  • trunk/src/world_entities/space_ships/collision_probe.h

    r8490 r9869  
    1313class CollisionProbe : public Playable
    1414{
     15  ObjectListDeclaration(CollisionProbe);
    1516
    1617  public:
  • trunk/src/world_entities/space_ships/cruizer.cc

    r9235 r9869  
    2929
    3030#include "graphics_engine.h"
    31 #include "dot_emitter.h"
    32 #include "sprite_particles.h"
     31#include "particles/dot_emitter.h"
     32#include "particles/sprite_particles.h"
    3333
    3434#include "debug.h"
    3535
    36 CREATE_FACTORY(Cruizer, CL_CRUIZER);
     36#include "class_id_DEPRECATED.h"
     37ObjectListDefinitionID(Cruizer, CL_CRUIZER);
     38CREATE_FACTORY(Cruizer);
    3739
    3840/**
     
    8991{
    9092  //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    91   this->setClassID(CL_CRUIZER, "Cruizer");
     93  this->registerObject(this, Cruizer::_objectList);
    9294
    9395  this->setSupportedPlaymodes(Playable::Full3D);
  • trunk/src/world_entities/space_ships/cruizer.h

    r9061 r9869  
    1616class Cruizer : public Playable
    1717{
     18  ObjectListDeclaration(Cruizer);
    1819  public:
    1920    Cruizer(const std::string& fileName);
  • trunk/src/world_entities/space_ships/helicopter.cc

    r9235 r9869  
    2525
    2626#include "util/loading/factory.h"
    27 #include "util/loading/resource_manager.h"
     27#include "sound/resource_sound_buffer.h"
    2828
    2929#include "key_mapper.h"
     
    3434#include "debug.h"
    3535
    36 CREATE_FACTORY(Helicopter, CL_HELICOPTER);
     36#include "class_id_DEPRECATED.h"
     37ObjectListDefinitionID(Helicopter, CL_HELICOPTER);
     38CREATE_FACTORY(Helicopter);
    3739#include "script_class.h"
    38 CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER,
    39                         addMethod("moveUp", ExecutorLua1<Helicopter,bool>(&Helicopter::moveUp))
    40                             ->addMethod("moveDown", ExecutorLua1<Helicopter,bool>(&Helicopter::moveDown))
    41                             ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
    42                             ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
    43                             ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))
    44                             ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))
     40CREATE_SCRIPTABLE_CLASS(Helicopter,
     41                        addMethod("moveUp", Executor1<Helicopter, lua_State*,bool>(&Helicopter::moveUp))
     42                            ->addMethod("moveDown", Executor1<Helicopter, lua_State*,bool>(&Helicopter::moveDown))
     43                            ->addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor))
     44                            ->addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX))
     45                            ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY))
     46                            ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
    4547
    4648                       );
    4749
     50
    4851/**
    4952 *  creates the controlable Helicopter
     
    6063{
    6164  this->setPlayer(NULL);
    62 
    63   if (this->chopperBuffer != NULL)
    64     ResourceManager::getInstance()->unload(this->chopperBuffer);
    6565}
    6666
     
    100100  Weapon* wpLeft = new TestGun(1);
    101101  wpLeft->setName("testGun Left");
    102   Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_CANNON));
     102  Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate("Cannon"));
    103103
    104104  cannon->setName("BFG");
     
    112112
    113113  //load sound
    114   if (this->chopperBuffer != NULL)
    115     ResourceManager::getInstance()->unload(this->chopperBuffer);
    116   this->chopperBuffer = (OrxSound::SoundBuffer*)ResourceManager::getInstance()->load("sound/engine/chopper.wav", WAV);
     114  this->chopperBuffer = OrxSound::ResourceSoundBuffer("sound/engine/chopper.wav");
    117115
    118116}
     
    124122void Helicopter::init()
    125123{
    126   this->chopperBuffer = NULL;
    127 
    128   this->setClassID(CL_HELICOPTER, "Helicopter");
     124  this->registerObject(this, Helicopter::_objectList);
    129125  PRINTF(4)("HELICOPTER INIT\n");
    130126
  • trunk/src/world_entities/space_ships/helicopter.h

    r9235 r9869  
    1717class Helicopter : public Playable
    1818{
     19  ObjectListDeclaration(Helicopter);
    1920
    2021  public:
     
    7980
    8081    OrxSound::SoundSource  soundSource;
    81     OrxSound::SoundBuffer* chopperBuffer;
     82    OrxSound::SoundBuffer  chopperBuffer;
    8283
    8384};
  • trunk/src/world_entities/space_ships/hover.cc

    r9656 r9869  
    3434#include "debug.h"
    3535
    36 CREATE_FACTORY(Hover, CL_HOVER);
     36#include "class_id_DEPRECATED.h"
     37ObjectListDefinitionID(Hover, CL_HOVER);
     38CREATE_FACTORY(Hover);
    3739
    3840#include "script_class.h"
    39 CREATE_SCRIPTABLE_CLASS(Hover, CL_HOVER,
    40                         addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer))
     41CREATE_SCRIPTABLE_CLASS(Hover,
     42                        addMethod("hasPlayer", Executor0ret<Playable, lua_State*,bool>(&Playable::hasPlayer))
    4143                        //Coordinates
    42                         ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
    43                         ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
    44                         ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))
    45                         ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))
     44                            ->addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor))
     45                            ->addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX))
     46                            ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY))
     47                            ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
    4648                       );
    4749
     
    98100  Weapon* wpLeft = new TestGun(1);
    99101  wpLeft->setName("testGun Left");
    100   Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate(CL_HYPERBLASTER));
     102  Weapon* cannon = dynamic_cast<Weapon*>(Factory::fabricate("Hyperblaster"));
    101103
    102104  cannon->setName("BFG");
     
    123125
    124126  //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    125   this->setClassID(CL_HOVER, "Hover");
     127  this->registerObject(this, Hover::_objectList);
    126128  this->toReflectionList();
    127129
  • trunk/src/world_entities/space_ships/hover.h

    r9235 r9869  
    1515class Hover : public Playable
    1616{
     17  ObjectListDeclaration(Hover);
    1718  public:
    1819
  • trunk/src/world_entities/space_ships/space_ship.cc

    r9656 r9869  
    2626#include "weapons/cannon.h"
    2727
    28 #include "dot_emitter.h"
    29 #include "sprite_particles.h"
     28#include "particles/dot_emitter.h"
     29#include "particles/sprite_particles.h"
    3030
    3131#include "util/loading/factory.h"
     
    5353
    5454
    55 
    56 CREATE_FACTORY(SpaceShip, CL_SPACE_SHIP);
     55#include "class_id_DEPRECATED.h"
     56ObjectListDefinitionID(SpaceShip, CL_SPACE_SHIP);
     57CREATE_FACTORY(SpaceShip);
     58
    5759#include "script_class.h"
    58 CREATE_SCRIPTABLE_CLASS(SpaceShip, CL_SPACE_SHIP,
    59                         addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer))
    60                         ->addMethod("fire", ExecutorLua1<Playable, bool>(&Playable::fire))
    61                         ->addMethod("loadModel", ExecutorLua2<WorldEntity,const std::string& ,float>(&WorldEntity::loadModel2))
    62                         ->addMethod("setName", ExecutorLua1<BaseObject,const std::string&>(&BaseObject::setName))
    63                         ->addMethod("hide", ExecutorLua0<WorldEntity>(&WorldEntity::hide))
    64                         ->addMethod("unhide", ExecutorLua0<WorldEntity>(&WorldEntity::unhide))
    65                        //Coordinates
    66                         ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
    67                         ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
    68                         ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))
    69                         ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))
     60CREATE_SCRIPTABLE_CLASS(SpaceShip,
     61                        addMethod("hasPlayer", Executor0ret<Playable, lua_State*,bool>(&Playable::hasPlayer))
     62                        ->addMethod("fire", Executor1<Playable, lua_State*, bool>(&Playable::fire))
     63                        ->addMethod("loadModel", Executor2<WorldEntity, lua_State*,const std::string& ,float>(&WorldEntity::loadModel2))
     64                        ->addMethod("setName", Executor1<BaseObject, lua_State*,const std::string&>(&BaseObject::setName))
     65                        ->addMethod("hide", Executor0<WorldEntity, lua_State*>(&WorldEntity::hide))
     66                        ->addMethod("unhide", Executor0<WorldEntity, lua_State*>(&WorldEntity::unhide))
     67                        //Coordinates
     68                        ->addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor))
     69                        ->addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX))
     70                        ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY))
     71                        ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
    7072                       );
    7173
     
    116118void SpaceShip::init()
    117119{
    118 //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    119   this->setClassID(CL_SPACE_SHIP, "SpaceShip");
     120  //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
     121  this->registerObject(this, SpaceShip::_objectList);
    120122
    121123  PRINTF(4)("SPACESHIP INIT\n");
     
    145147  controlVelocityY = 150;
    146148  shipInertia = 1.5;
    147 //  cycle = 0.0;
     149  //  cycle = 0.0;
    148150
    149151  this->setHealthMax(100);
     
    156158  this->pitchDir = this->getAbsDir();
    157159
    158 //   GLGuiButton* button = new GLGuiPushButton();
    159 //    button->show();
    160 //    button->setLabel("orxonox");
    161 //    button->setBindNode(this);
    162 //     GLGuiBar* bar = new GLGuiBar();
    163 //     bar->show();
    164 //     bar->setValue(7.0);
    165 //     bar->setMaximum(10);
    166 //     bar->setSize2D( 20, 100);
    167 //     bar->setAbsCoor2D( 10, 200);
     160  //   GLGuiButton* button = new GLGuiPushButton();
     161  //    button->show();
     162  //    button->setLabel("orxonox");
     163  //    button->setBindNode(this);
     164  //     GLGuiBar* bar = new GLGuiBar();
     165  //     bar->show();
     166  //     bar->setValue(7.0);
     167  //     bar->setMaximum(10);
     168  //     bar->setSize2D( 20, 100);
     169  //     bar->setAbsCoor2D( 10, 200);
    168170
    169171  //add events to the eventlist
     
    200202  this->getWeaponManager().setSlotPosition(5, Vector(-1.5, -.5, -.5));
    201203  this->getWeaponManager().setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
    202 //
    203    this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0));
    204    this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    205    //
    206 //   this->getWeaponManager().setSlotPosition(8, Vector(-2.5, -0.3, -2.0));
    207 //   this->getWeaponManager().setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0)));
    208 //
    209 //   this->getWeaponManager().setSlotPosition(9, Vector(-2.5, -0.3, 2.0));
    210 //   this->getWeaponManager().setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));:
     204  //
     205  this->getWeaponManager().setSlotPosition(6, Vector(-1, 0.0, 0));
     206  this->getWeaponManager().setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     207  //
     208  //   this->getWeaponManager().setSlotPosition(8, Vector(-2.5, -0.3, -2.0));
     209  //   this->getWeaponManager().setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0)));
     210  //
     211  //   this->getWeaponManager().setSlotPosition(9, Vector(-2.5, -0.3, 2.0));
     212  //   this->getWeaponManager().setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));:
    211213
    212214  this->getWeaponManager().getFixedTarget()->setParent(this);
     
    310312void SpaceShip::collidesWith(WorldEntity* entity, const Vector& location)
    311313{
    312 
    313314}
    314315
     
    332333
    333334  if( ( xMouse != 0 || yMouse != 0 ) && this->getOwner() == SharedNetworkData::getInstance()->getHostID() )
    334    {
     335  {
    335336    if (xMouse > controlVelocityX) xMouse = controlVelocityX;
    336337    else if (xMouse < -controlVelocityX) xMouse = -controlVelocityX;
     
    342343    mouseDir *= (Quaternion(-M_PI/4*xMouse*mouseSensitivity, Vector(0,1,0))*Quaternion(-M_PI/4*yMouse*mouseSensitivity*yInvert, Vector(0,0,1))*pitchDir);
    343344    xMouse = yMouse = 0;
    344    }
    345 
    346 
    347 //   if( this != State::getPlayer()->getControllable())
    348 //     return;
     345  }
     346
     347
     348  //   if( this != State::getPlayer()->getControllable())
     349  //     return;
    349350
    350351  // spaceship controlled movement fire(bool bF){ this->bFire = bF;}
    351352  //if (this->getOwner() == this->getHostID())
    352     this->calculateVelocity(time);
     353  this->calculateVelocity(time);
    353354
    354355
     
    363364
    364365  //orient the spaceship in direction of the mouse
    365    rotQuat = Quaternion::quatSlerp( this->getAbsDir(), mouseDir, 0.5);//fabsf(time)*shipInertia);
    366    if (this->getAbsDir().distance(rotQuat) > 0.00000000000001)
     366  rotQuat = Quaternion::quatSlerp( this->getAbsDir(), mouseDir, 0.5);//fabsf(time)*shipInertia);
     367  if (this->getAbsDir().distance(rotQuat) > 0.00000000000001)
    367368    this->setAbsDir( rotQuat);
    368    //this->setAbsDirSoft(mouseDir,5);
     369  //this->setAbsDirSoft(mouseDir,5);
    369370
    370371  // this is the air friction (necessary for a smooth control)
     
    388389  this->shiftCoor(move);
    389390
    390 //   PRINTF(0)("id of %s is: %i\n", this->getName(), this->getOMListNumber());
     391  //   PRINTF(0)("id of %s is: %i\n", this->getName(), this->getOMListNumber());
    391392
    392393}
     
    409410
    410411  if( this->bUp )
    411    {
    412      //this->shiftCoor(this->getAbsDirX());
    413       //accel += (this->getAbsDirX())*2;
    414       accel += (this->getAbsDirX())*acceleration;
    415 
    416    }
     412  {
     413    //this->shiftCoor(this->getAbsDirX());
     414    //accel += (this->getAbsDirX())*2;
     415    accel += (this->getAbsDirX())*acceleration;
     416
     417  }
    417418
    418419  if( this->bDown )
    419    {
    420      //this->shiftCoor((this->getAbsDirX())*-1);
    421      //accel -= (this->getAbsDirX())*2;
     420  {
     421    //this->shiftCoor((this->getAbsDirX())*-1);
     422    //accel -= (this->getAbsDirX())*2;
    422423    //if(velocity.len() > 50)
    423      accel -= (this->getAbsDirX())*0.5*acceleration;
    424 
    425 
    426 
    427    }
     424    accel -= (this->getAbsDirX())*0.5*acceleration;
     425
     426
     427
     428  }
    428429
    429430  if( this->bLeft/* > -this->getRelCoor().z*2*/)
    430431  {
    431432    this->shiftDir(Quaternion(time, Vector(0,1,0)));
    432 //    accel -= rightDirection;
     433    //    accel -= rightDirection;
    433434    //velocityDir.normalize();
    434435    //rot +=Vector(1,0,0);
     
    449450  {
    450451    mouseDir *= Quaternion(-time*2, Vector(1,0,0));
    451 //    accel -= rightDirection;
     452    //    accel -= rightDirection;
    452453    //velocityDir.normalize();
    453454    //rot +=Vector(1,0,0);
     
    467468    this->shiftDir(Quaternion(time, Vector(0,0,1)));
    468469
    469 //    accel += upDirection;
     470    //    accel += upDirection;
    470471    //velocityDir.normalize();
    471472    //rot += Vector(0,0,1);
     
    495496
    496497  if( event.type == KeyMapper::PEV_LEFT)
    497       this->bRollL = event.bPressed;
     498    this->bRollL = event.bPressed;
    498499  else if( event.type == KeyMapper::PEV_RIGHT)
    499       this->bRollR = event.bPressed;
     500    this->bRollR = event.bPressed;
    500501  else if( event.type == KeyMapper::PEV_FORWARD)
    501502    this->bUp = event.bPressed; //this->shiftCoor(0,.1,0);
  • trunk/src/world_entities/space_ships/space_ship.h

    r9235 r9869  
    1919class SpaceShip : public Playable
    2020{
     21  ObjectListDeclaration(SpaceShip);
    2122
    2223  public:
     
    3637    virtual void postSpawn();
    3738    virtual void leftWorld();
    38    
     39
    3940    virtual void destroy(WorldEntity* killer);
    4041    virtual void respawn();
  • trunk/src/world_entities/space_ships/spacecraft_2d.cc

    r9406 r9869  
    3030
    3131#include "graphics_engine.h"
    32 #include "dot_emitter.h"
    33 #include "sprite_particles.h"
     32#include "particles/dot_emitter.h"
     33#include "particles/sprite_particles.h"
    3434
    3535#include "debug.h"
     
    3838
    3939
    40 CREATE_FACTORY(Spacecraft2D, CL_SPACECRAFT_2D);
    41 
    42 
    43 CREATE_SCRIPTABLE_CLASS(Spacecraft2D, CL_SPACECRAFT_2D,
    44                         addMethod("hasPlayer", ExecutorLua0ret<Playable,bool>(&Playable::hasPlayer))
     40#include "class_id_DEPRECATED.h"
     41ObjectListDefinitionID(Spacecraft2D, CL_SPACECRAFT_2D);
     42CREATE_FACTORY(Spacecraft2D);
     43
     44CREATE_SCRIPTABLE_CLASS(Spacecraft2D,
     45                        addMethod("hasPlayer", Executor0ret<Playable, lua_State*,bool>(&Playable::hasPlayer))
    4546                        //Coordinates
    46                         ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))
    47                         ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))
    48                         ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))
    49                         ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))
    50                         ->addMethod("setAirFriction", ExecutorLua1<Spacecraft2D, float>(&Spacecraft2D::setAirFriction))
     47                            ->addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor))
     48                            ->addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX))
     49                            ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY))
     50                            ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
     51                            ->addMethod("setAirFriction", Executor1<Spacecraft2D, lua_State*, float>(&Spacecraft2D::setAirFriction))
    5152                       );
     53
    5254
    5355
     
    8587
    8688  //weapons:
    87   Weapon* wpRight = dynamic_cast<Weapon*>(Factory::fabricate(CL_LASER_CANNON));
     89  Weapon* wpRight = dynamic_cast<Weapon*>(Factory::fabricate("LaserCannon"));
    8890  wpRight->setName("Cannon_Right");
    89   Weapon* wpLeft = dynamic_cast<Weapon*>(Factory::fabricate(CL_LASER_CANNON));
     91  Weapon* wpLeft = dynamic_cast<Weapon*>(Factory::fabricate("LaserCannon"));
    9092  wpLeft->setName("Cannon_Left");
    9193
    92   Weapon* turretLeft = dynamic_cast<Weapon*>(Factory::fabricate(CL_BOOMERANG_GUN));
     94  Weapon* turretLeft = dynamic_cast<Weapon*>(Factory::fabricate("BoomerangGun"));
    9395  wpRight->setName("Turret_Left");
    94   Weapon* turretRight = dynamic_cast<Weapon*>(Factory::fabricate(CL_BOOMERANG_GUN));
     96  Weapon* turretRight = dynamic_cast<Weapon*>(Factory::fabricate("BoomerangGun"));
    9597  wpLeft->setName("Turret_Right");
    9698
     
    125127{
    126128  //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    127   this->setClassID(CL_SPACECRAFT_2D, "Spacecraft2D");
     129  this->registerObject(this, Spacecraft2D::_objectList);
    128130
    129131  this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal );
  • trunk/src/world_entities/space_ships/spacecraft_2d.h

    r9235 r9869  
    1616class Spacecraft2D : public Playable
    1717{
     18  ObjectListDeclaration(Spacecraft2D);
    1819  public:
    1920    Spacecraft2D(const std::string& fileName);
  • trunk/src/world_entities/space_ships/turbine_hover.cc

    r9656 r9869  
    2929
    3030#include "graphics_engine.h"
    31 #include "dot_emitter.h"
    32 #include "sprite_particles.h"
     31#include "particles/dot_emitter.h"
     32#include "particles/sprite_particles.h"
    3333
    3434#include "debug.h"
    3535
    36 CREATE_FACTORY(TurbineHover, CL_TURBINE_HOVER);
     36#include "class_id_DEPRECATED.h"
     37ObjectListDefinitionID(TurbineHover, CL_TURBINE_HOVER);
     38CREATE_FACTORY(TurbineHover);
    3739
    3840/**
     
    101103{
    102104  //  this->setRelDir(Quaternion(M_PI, Vector(1,0,0)));
    103   this->setClassID(CL_TURBINE_HOVER, "TurbineHover");
     105  this->registerObject(this, TurbineHover::_objectList);
    104106
    105107  this->setSupportedPlaymodes(Playable::Full3D | Playable::Horizontal | Playable::Vertical);
  • trunk/src/world_entities/space_ships/turbine_hover.h

    r9656 r9869  
    1818class TurbineHover : public Playable
    1919{
    20   public:
    21     TurbineHover(const std::string& fileName);
    22     TurbineHover(const TiXmlElement* root = NULL);
    23     virtual ~TurbineHover();
     20  ObjectListDeclaration(TurbineHover);
     21public:
     22  TurbineHover(const std::string& fileName);
     23  TurbineHover(const TiXmlElement* root = NULL);
     24  virtual ~TurbineHover();
    2425
    25     void setBoostColor(const Color& color);
     26  void setBoostColor(const Color& color);
    2627
    27     virtual void loadParams(const TiXmlElement* root);
    28     virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f);
    29     virtual void enter();
    30     virtual void leave();
     28  virtual void loadParams(const TiXmlElement* root);
     29  virtual void setPlayDirection(const Quaternion& rot, float speed = 0.0f);
     30  virtual void enter();
     31  virtual void leave();
    3132
    32     virtual void setTeam(int teamID);
     33  virtual void setTeam(int teamID);
    3334
    34     virtual void postSpawn();
    35     virtual void leftWorld();
    36     virtual void respawn();
     35  virtual void postSpawn();
     36  virtual void leftWorld();
     37  virtual void respawn();
    3738
    38     virtual void collidesWith(WorldEntity* entity, const Vector& location);
    39     virtual void tick(float dt);
    40     virtual void draw() const;
     39  virtual void collidesWith(WorldEntity* entity, const Vector& location);
     40  virtual void tick(float dt);
     41  virtual void draw() const;
    4142
    42     virtual void process(const Event &event);
     43  virtual void process(const Event &event);
    4344
    44   private:
    45     void init();
    46     void movement(float dt);
     45private:
     46  void init();
     47  void movement(float dt);
    4748
    48   private:
    49     bool                  bForward;           //!< forward button pressed.
    50     bool                  bBackward;          //!< backward button pressed.
    51     bool                  bLeft;              //!< left button pressed.
    52     bool                  bRight;             //!< right button pressed.
    53     bool                  bAscend;            //!< ascend button pressed.
    54     bool                  bDescend;           //!< descend button presses.
     49private:
     50  bool                  bForward;           //!< forward button pressed.
     51  bool                  bBackward;          //!< backward button pressed.
     52  bool                  bLeft;              //!< left button pressed.
     53  bool                  bRight;             //!< right button pressed.
     54  bool                  bAscend;            //!< ascend button pressed.
     55  bool                  bDescend;           //!< descend button presses.
    5556
    56     int                   yInvert;
    57     float                 mouseSensitivity;   //!< the mouse sensitivity
     57  int                   yInvert;
     58  float                 mouseSensitivity;   //!< the mouse sensitivity
    5859
    59     PNode                 wingNodeLeft;
    60     PNode                 wingNodeRight;
    61     PNode                 rotorNodeLeft;
    62     PNode                 rotorNodeRight;
     60  PNode                 wingNodeLeft;
     61  PNode                 wingNodeRight;
     62  PNode                 rotorNodeLeft;
     63  PNode                 rotorNodeRight;
    6364
    64     PNode                 cameraNode;
    65     float                 cameraLook;
    66     float                 rotation;
     65  PNode                 cameraNode;
     66  float                 cameraLook;
     67  float                 rotation;
    6768
    68    // Vector                velocity;           //!< the velocity of the TurbineHover.
    69     Quaternion            direction;          //!< the direction of the TurbineHover.
    70     float                 travelSpeed;        //!< the current speed of the Hove (to make soft movement)
    71     float                 acceleration;       //!< the acceleration of the TurbineHover.
    72     float                 airFriction;        //!< AirFriction.
     69  // Vector                velocity;           //!< the velocity of the TurbineHover.
     70  Quaternion            direction;          //!< the direction of the TurbineHover.
     71  float                 travelSpeed;        //!< the current speed of the Hove (to make soft movement)
     72  float                 acceleration;       //!< the acceleration of the TurbineHover.
     73  float                 airFriction;        //!< AirFriction.
    7374
    74     float                 rotorSpeed;         //!< the speed of the rotor.
    75     float                 rotorCycle;         //!< The Cycle the rotor is in.
     75  float                 rotorSpeed;         //!< the speed of the rotor.
     76  float                 rotorCycle;         //!< The Cycle the rotor is in.
    7677
    77     float                 airViscosity;
     78  float                 airViscosity;
    7879
    79     ParticleEmitter*      burstEmitter[2];
    80     ParticleSystem*       burstSystem;
     80  ParticleEmitter*      burstEmitter[2];
     81  ParticleSystem*       burstSystem;
    8182};
    8283
Note: See TracChangeset for help on using the changeset viewer.