Changeset 10771 in orxonox.OLD for branches/presentation/src/world_entities/weapons/disruptor.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/disruptor.cc
r10747 r10771 55 55 Disruptor::~Disruptor() 56 56 { 57 for (int i = 0; i < this->getBarrels(); i++)58 {59 delete [] this->shootAnim[i];60 delete [] this->objComp[i];61 }62 delete [] this->emissionPoint;63 64 delete [] this->shootAnim;65 delete [] this->objComp;66 67 57 } 68 58 … … 99 89 this->setBarrels(1); 100 90 this->setSegs(1); 101 this->activeBarrel = 0;102 91 92 this->setEmissionPoint(Vector(1.672, 0.0, 0.0) * this->getScaling()); 103 93 104 105 this->objComp = new PNode**[this->getBarrels()]; 106 this->emissionPoint = new PNode*[this->getBarrels()]; 107 this->shootAnim = new Animation3D**[this->getBarrels()]; 108 for (int i = 0; i < this->getBarrels(); i++) 109 { 110 this->objComp[i] = new PNode* [this->getSegs()]; 111 this->emissionPoint[i] = new PNode; 112 this->emissionPoint[i]->setParent(this); //Parenting emissionPoint to Weapon 113 this->emissionPoint[i]->setName("EmissionPoint"); 114 this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT); 115 this->shootAnim[i] = new Animation3D* [this->getSegs()]; 116 for(int j = 0; j < this->getSegs(); j++) 117 { 118 this->objComp[i][j] = new PNode; 119 this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]); 120 this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT); 121 } 122 } 123 124 this->emissionPoint[0]->setRelCoor(Vector(1.672, 0.0, 0.0) * this->getScaling()); 125 126 127 this->shootAnim[0][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL); 128 this->shootAnim[0][0]->addKeyFrame(Vector(-0.5, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL); 94 this->getShootAnim(0, 0)->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL); 95 this->getShootAnim(0, 0)->addKeyFrame(Vector(-0.5, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.2, ANIM_LINEAR, ANIM_NULL); 129 96 // this->shootAnim[0][0]->addKeyFrame(Vector(0.0, 0.0, 0.0) * this->getScaling(), Quaternion(), 0.1, ANIM_LINEAR, ANIM_NULL); 130 97 … … 158 125 pj->setVelocity((tmp.getNormalized())*130 + VECTOR_RAND(1)); 159 126 160 pj->setAbsCoor(this-> emissionPoint[this->activeBarrel]->getAbsCoor());127 pj->setAbsCoor(this->getEmissionPoint()); 161 128 pj->setAbsDir(this->getAbsDir()); 162 129 pj->activate(); 163 130 164 131 165 this-> shootAnim[0][0]->replay();132 this->getShootAnim(0, 0)->replay(); 166 133 } 167 134 … … 196 163 // Barrel 197 164 glPushMatrix(); 198 glTranslatef(this-> objComp[0][0]->getAbsCoor().x, this->objComp[0][0]->getAbsCoor().y, this->objComp[0][0]->getAbsCoor().z);165 glTranslatef(this->getObjCompx(0,0), this->getObjCompy(0,0), this->getObjCompz(0,0)); 199 166 static_cast<StaticModel*>(this->getModel())->draw(0); 200 167 glPopMatrix(); 168 201 169 glPopMatrix(); 202 170 }
Note: See TracChangeset
for help on using the changeset viewer.