Changeset 10771 in orxonox.OLD for branches/presentation/src/world_entities/weapons/medium_blaster.cc
- Timestamp:
- Jun 27, 2007, 7:01:08 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/world_entities/weapons/medium_blaster.cc
r10698 r10771 54 54 MediumBlaster::~MediumBlaster() 55 55 { 56 // model will be deleted from WorldEntity-destructor57 for (int i = 0; i < this->getBarrels(); i++)58 {59 delete [] this->shootAnim[i];60 }61 delete [] this->shootAnim;62 56 } 63 57 … … 76 70 77 71 this->setStateDuration(WS_RELOADING, 0); 78 this->setStateDuration(WS_ACTIVATING, .5); //.5);79 this->setStateDuration(WS_DEACTIVATING, 1); // 1);72 this->setStateDuration(WS_ACTIVATING, .5); 73 this->setStateDuration(WS_DEACTIVATING, 1); 80 74 81 75 this->setEnergyMax(500); … … 94 88 this->setBarrels(1); 95 89 this->setSegs(2); 96 this->activeBarrel = 0;97 90 98 this->objComp = new PNode**[this->getBarrels()];99 this->emissionPoint = new PNode*[this->getBarrels()];100 this->shootAnim = new Animation3D**[this->getBarrels()];101 for (int i = 0; i < this->getBarrels(); i++)102 {103 this->objComp[i] = new PNode* [this->getSegs()];104 this->emissionPoint[i] = new PNode;105 this->emissionPoint[i]->setParent(this); //Parenting emissionPoint to Weapon106 this->emissionPoint[i]->setName("EmissionPoint");107 this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);108 this->shootAnim[i] = new Animation3D* [this->getSegs()];109 for(int j = 0; j < this->getSegs(); j++)110 {111 this->objComp[i][j] = new PNode;112 this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]);113 this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT);114 }115 }116 91 117 92 for (int i = 0; i < this->getBarrels(); i++){ 118 this-> shootAnim[i][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.04, ANIM_LINEAR, ANIM_NULL);119 this-> shootAnim[i][0]->addKeyFrame(Vector(-1.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.15, ANIM_LINEAR, ANIM_NULL);120 this-> shootAnim[i][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.01, ANIM_LINEAR, ANIM_NULL);93 this->getShootAnim(i, 0)->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.04, ANIM_LINEAR, ANIM_NULL); 94 this->getShootAnim(i, 0)->addKeyFrame(Vector(-1.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.15, ANIM_LINEAR, ANIM_NULL); 95 this->getShootAnim(i, 0)->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.01, ANIM_LINEAR, ANIM_NULL); 121 96 122 this-> shootAnim[i][1]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.04, ANIM_LINEAR, ANIM_NULL);123 this-> shootAnim[i][1]->addKeyFrame(Vector(.5, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.15, ANIM_LINEAR, ANIM_NULL);124 this-> shootAnim[i][1]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.01, ANIM_LINEAR, ANIM_NULL);97 this->getShootAnim(i, 1)->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.04, ANIM_LINEAR, ANIM_NULL); 98 this->getShootAnim(i, 1)->addKeyFrame(Vector(.5, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.15, ANIM_LINEAR, ANIM_NULL); 99 this->getShootAnim(i, 1)->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.01, ANIM_LINEAR, ANIM_NULL); 125 100 } 126 101 … … 131 106 animation3->setInfinity(ANIM_INF_CONSTANT); 132 107 133 this-> emissionPoint[0]->setRelCoor(Vector(3.9, 0.0, 0.0) * this->getScaling());108 this->setEmissionPoint(Vector(3.9, 0.0, 0.0) * this->getScaling()); 134 109 135 110 animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); … … 159 134 160 135 for (int i = 0; i < this->getSegs(); i++) 161 this-> shootAnim[this->activeBarrel][i]->replay();136 this->getShootAnim(this->getActiveBarrel(), i)->replay(); // FIXME needs clean up 162 137 } 163 138 … … 187 162 188 163 glPushMatrix(); 189 glTranslatef (this-> objComp[0][0]->getAbsCoor().x, this->objComp[0][0]->getAbsCoor().y, this->objComp[0][0]->getAbsCoor().z);164 glTranslatef (this->getObjCompx(0,0), this->getObjCompy(0,0), this->getObjCompz(0,0)); 190 165 static_cast<StaticModel*>(this->getModel())->draw(1); 191 166 glPopMatrix(); 192 167 193 168 glPushMatrix(); 194 glTranslatef (this-> objComp[0][1]->getAbsCoor().x, this->objComp[0][1]->getAbsCoor().y, this->objComp[0][1]->getAbsCoor().z);169 glTranslatef (this->getObjCompx(0,1), this->getObjCompy(0,1), this->getObjCompz(0,1)); 195 170 static_cast<StaticModel*>(this->getModel())->draw(2); 196 171 glPopMatrix();
Note: See TracChangeset
for help on using the changeset viewer.