Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10133 in orxonox.OLD for branches/playability


Ignore:
Timestamp:
Dec 20, 2006, 7:45:55 PM (18 years ago)
Author:
nicolasc
Message:

animation in heavy blaster

Location:
branches/playability/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/lib/graphics/importer/objModel.cc

    r9869 r10133  
    139139        }
    140140      // case group
    141       else if (!strncmp(buffer, "g ", 2))
     141      else if (!strncmp(buffer, "g ", 2) || !strncmp(buffer, "o ", 2))
    142142        {
    143143          this->addGroup (buffer+2);
  • branches/playability/src/world_entities/space_ships/space_ship.cc

    r10132 r10133  
    185185
    186186 
    187   this->weaponMan.changeWeaponConfig(1);
     187  this->weaponMan.changeWeaponConfig(2);
    188188  this->secWeaponMan.changeWeaponConfig(0);
    189189
     
    282282  this->weaponMan.setSlotDirection(3, Quaternion(M_PI_4*.5, Vector(1,0,0)));
    283283
    284   this->weaponMan.setSlotPosition(4, Vector(-1.5, 0, .5));
     284  this->weaponMan.setSlotPosition(4, Vector(1.5, 0, .5));
    285285  this->weaponMan.setSlotDirection(4, Quaternion(-M_PI_4*.5+M_PI, Vector(1,0,0)));
    286286
    287   this->weaponMan.setSlotPosition(5, Vector(-1.5, 0, -.5));
     287  this->weaponMan.setSlotPosition(5, Vector(1.5, 0, -.5));
    288288  this->weaponMan.setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
    289289
  • branches/playability/src/world_entities/weapons/heavy_blaster.cc

    r10109 r10133  
    4848//  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
    4949
    50   this->loadModel("models/guns/plasmadriver_#.obj", 1.0);
     50  this->loadModel("models/guns/fragcannon.obj", .4);
    5151 
    5252
     
    6868  this->prepareProjectiles(5);
    6969
     70  this->objComp1 = new PNode;
     71  this->objComp2 = new PNode;
     72  this->objComp3 = new PNode;
     73  this->objComp4 = new PNode;
     74  this->objComp5 = new PNode;
     75  this->objComp6 = new PNode;
     76
     77  Animation3D* animB0Shoot = this->getAnimation(WS_SHOOTING, this->objComp1);
     78  Animation3D* animB1Shoot = this->getAnimation(WS_SHOOTING, this->objComp2);
     79  Animation3D* animB2Shoot = this->getAnimation(WS_SHOOTING, this->objComp3);
     80  Animation3D* animT0Shoot = this->getAnimation(WS_SHOOTING, this->objComp4);
     81  Animation3D* animT1Shoot = this->getAnimation(WS_SHOOTING, this->objComp5);
     82  Animation3D* animT2Shoot = this->getAnimation(WS_SHOOTING, this->objComp6);
     83
     84  animB0Shoot->setInfinity(ANIM_INF_CONSTANT);
     85  animB1Shoot->setInfinity(ANIM_INF_CONSTANT);
     86  animB2Shoot->setInfinity(ANIM_INF_CONSTANT);
     87  animT0Shoot->setInfinity(ANIM_INF_CONSTANT);
     88  animT1Shoot->setInfinity(ANIM_INF_CONSTANT);
     89  animT2Shoot->setInfinity(ANIM_INF_CONSTANT);
     90
     91  animB0Shoot->addKeyFrame(Vector(0.1, 0.0, 0.0), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
     92  animB0Shoot->addKeyFrame(Vector(-0.1, 0.0, 0.0), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
     93  animB0Shoot->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_NULL);
     94
     95  animT0Shoot->addKeyFrame(Vector(0.14, 0.0, 0.0), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
     96  animT0Shoot->addKeyFrame(Vector(-0.14, 0.0, 0.0), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
     97  animT0Shoot->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_NULL);
     98
     99  animB1Shoot->addKeyFrame(Vector(0.1, 0.0, 0.0), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
     100  animB1Shoot->addKeyFrame(Vector(-0.1, 0.0, 0.0), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
     101  animB1Shoot->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_NULL);
     102
     103  animT1Shoot->addKeyFrame(Vector(0.14, 0.0, 0.0), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
     104  animT1Shoot->addKeyFrame(Vector(-0.14, 0.0, 0.0), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
     105  animT1Shoot->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_NULL);
     106
     107  animB2Shoot->addKeyFrame(Vector(0.1, 0.0, 0.0), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
     108  animB2Shoot->addKeyFrame(Vector(-0.1, 0.0, 0.0), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
     109  animB2Shoot->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_NULL);
     110
     111  animT2Shoot->addKeyFrame(Vector(0.14, 0.0, 0.0), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
     112  animT2Shoot->addKeyFrame(Vector(-0.14, 0.0, 0.0), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL);
     113  animT2Shoot->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_NULL);
     114
    70115  Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this);
    71116  Animation3D* animation3 = this->getAnimation(WS_DEACTIVATING, this);
     
    121166void HeavyBlaster::draw() const
    122167{
    123 }
     168  glMatrixMode(GL_MODELVIEW);
     169  glPushMatrix();
     170  glTranslatef (this->getAbsCoor ().x,
     171                this->getAbsCoor ().y,
     172                this->getAbsCoor ().z);
     173
     174  static_cast<StaticModel*>(this->getModel())->draw(6);
     175
     176  glPushMatrix();
     177  glTranslatef (this->objComp1->getAbsCoor().x, this->objComp1->getAbsCoor().y, this->objComp1->getAbsCoor().z);
     178  static_cast<StaticModel*>(this->getModel())->draw(1);
     179  static_cast<StaticModel*>(this->getModel())->draw(2);
     180  static_cast<StaticModel*>(this->getModel())->draw(0);
     181  glPopMatrix();
     182/*
     183  glPushMatrix();
     184  glTranslatef (this->objComp2->getAbsCoor().x, this->objComp2->getAbsCoor().y, this->objComp2->getAbsCoor().z);
     185  static_cast<StaticModel*>(this->getModel())->draw(2);
     186  glPopMatrix();
     187
     188  glPushMatrix();
     189  glTranslatef (this->objComp3->getAbsCoor().x, this->objComp3->getAbsCoor().y, this->objComp3->getAbsCoor().z);
     190  static_cast<StaticModel*>(this->getModel())->draw(0);
     191  glPopMatrix();*/
     192/*
     193  glTranslatef (this->objComp4->getAbsCoor().x, this->objComp4->getAbsCoor().y, this->objComp4->getAbsCoor().z);
     194  static_cast<StaticModel*>(this->getModel())->draw(4);
     195  static_cast<StaticModel*>(this->getModel())->draw(5);
     196  static_cast<StaticModel*>(this->getModel())->draw(3);
     197  glPopMatrix();*/
     198/*
     199  glPushMatrix();
     200  glTranslatef (this->objComp5->getAbsCoor().x, this->objComp5->getAbsCoor().y, this->objComp5->getAbsCoor().z);
     201  static_cast<StaticModel*>(this->getModel())->draw(5);
     202  glPopMatrix();
     203
     204  glPushMatrix();
     205  glTranslatef (this->objComp6->getAbsCoor().x, this->objComp6->getAbsCoor().y, this->objComp6->getAbsCoor().z);
     206  static_cast<StaticModel*>(this->getModel())->draw(3);
     207  glPopMatrix();*/
     208
     209  glPopMatrix();
     210}
  • branches/playability/src/world_entities/weapons/heavy_blaster.h

    r9998 r10133  
    2828    virtual void draw() const;
    2929
     30  private:
     31    PNode* objComp1;
     32    PNode* objComp2;
     33    PNode* objComp3;
     34    PNode* objComp4;
     35    PNode* objComp5;
     36    PNode* objComp6;
    3037};
    3138
Note: See TracChangeset for help on using the changeset viewer.