Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5623 in orxonox.OLD for branches/world_entities


Ignore:
Timestamp:
Nov 17, 2005, 1:22:17 AM (19 years ago)
Author:
bensch
Message:

orxonox/branches/world_entities: cannon has again animations

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/world_entities/src/world_entities/weapons/cannon.cc

    r5622 r5623  
    5252{
    5353  this->init();
     54}
     55
     56
     57Cannon::Cannon(const TiXmlElement* root)
     58{
     59  this->init();
     60  this->loadParams(root);
     61}
     62
     63/**
     64 *  standard deconstructor
     65*/
     66Cannon::~Cannon ()
     67{
     68  // model will be deleted from WorldEntity-destructor
     69}
     70
     71
     72void Cannon::init()
     73{
     74  this->setClassID(CL_CANNON, "Cannon");
     75
     76//  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
     77
     78  this->loadModel("models/guns/cannon.obj");
     79
     80  this->setStateDuration(WS_SHOOTING, .1);
     81  this->setStateDuration(WS_RELOADING, .1);
     82  this->setStateDuration(WS_ACTIVATING, .4);
     83  this->setStateDuration(WS_DEACTIVATING, .4);
     84
     85  this->setMaximumEnergy(1000, 100);
     86  this->increaseEnergy(1000);
     87  //this->minCharge = 2;
     88
     89  this->setActionSound(WA_SHOOT, "sound/shot1.wav");
     90
     91  this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     92  this->setProjectileType(CL_LASER);
     93  this->prepareProjectiles(20);
    5494
    5595//  this->objectComponent1 = new PNode();
     
    64104  animation3->setInfinity(ANIM_INF_CONSTANT);
    65105
    66     this->setEmissionPoint(3.8, 1.2, 0);
     106  this->setEmissionPoint(3.8, 1.2, 0);
    67107
    68108//     animation1->addKeyFrame(Vector(0, -1.5, 0), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL);
     
    70110//     animation1->addKeyFrame(Vector(0, 0, 0), Quaternion(), 0.0, ANIM_LINEAR, ANIM_NULL);
    71111
    72     animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
    73     animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
    74 
    75     animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
    76     animation3->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
    77 }
    78 
    79 
    80 Cannon::Cannon(const TiXmlElement* root)
    81 {
    82   this->init();
    83   this->loadParams(root);
    84 }
    85 
    86 /**
    87  *  standard deconstructor
    88 */
    89 Cannon::~Cannon ()
    90 {
    91   // model will be deleted from WorldEntity-destructor
    92 }
    93 
    94 
    95 void Cannon::init()
    96 {
    97   this->setClassID(CL_CANNON, "Cannon");
    98 
    99 //  this->model = (Model*)ResourceManager::getInstance()->load("models/guns/test_gun.obj", OBJ, RP_CAMPAIGN);
    100 
    101   this->loadModel("models/guns/cannon.obj");
    102 
    103   this->setStateDuration(WS_SHOOTING, .1);
    104   this->setStateDuration(WS_RELOADING, .1);
    105   this->setStateDuration(WS_ACTIVATING, .4);
    106   this->setStateDuration(WS_DEACTIVATING, .4);
    107 
    108   this->setMaximumEnergy(1000, 100);
    109   this->increaseEnergy(1000);
    110   //this->minCharge = 2;
    111 
    112   this->setActionSound(WA_SHOOT, "sound/shot1.wav");
    113 
    114   this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
    115   this->setProjectileType(CL_LASER);
    116   this->prepareProjectiles(20);
    117 
     112  animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
     113  animation2->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
     114
     115  animation3->addKeyFrame(Vector(0.0, 0.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
     116  animation3->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL);
    118117}
    119118
Note: See TracChangeset for help on using the changeset viewer.