Changeset 10771 in orxonox.OLD for branches/presentation/src/world_entities/weapons/rf_cannon.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/rf_cannon.cc
r10728 r10771 55 55 RFCannon::~RFCannon() 56 56 { 57 for (int i = 0; i < this->getBarrels(); i++)58 delete [] this->objComp[i];59 60 delete [] this->emissionPoint;61 delete [] this->objComp;62 57 } 63 58 … … 91 86 this->setBarrels(4); 92 87 this->setSegs(1); 93 this-> activeBarrel =(rand() % 4);88 this->setActiveBarrel(rand() % 4); 94 89 95 this->objComp = new PNode**[this->getBarrels()];96 this->emissionPoint = new PNode*[this->getBarrels()];97 for (int i = 0; i < this->getBarrels(); i++) {98 this->objComp[i] = new PNode* [this->getSegs()];99 this->emissionPoint[i] = new PNode;100 this->emissionPoint[i]->setParent(this);101 this->emissionPoint[i]->setName("EmissionPoint");102 this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT);103 for(int j = 0; j < this->getSegs(); j++) {104 this->objComp[i][j] = new PNode;105 }106 }107 90 108 this-> emissionPoint[0]->setRelCoor(Vector(4.1, 0.0, 0.75) * this->getScaling());109 this-> emissionPoint[1]->setRelCoor(Vector(4.1, 0.45, 0.0) * this->getScaling());110 this-> emissionPoint[2]->setRelCoor(Vector(4.1, 0.0, -0.75) * this->getScaling());111 this-> emissionPoint[3]->setRelCoor(Vector(4.1, -0.45, 0.0) * this->getScaling());91 this->setEmissionPoint(Vector(4.1, 0.0, 0.75) * this->getScaling(), 0); 92 this->setEmissionPoint(Vector(4.1, 0.45, 0.0) * this->getScaling(), 1); 93 this->setEmissionPoint(Vector(4.1, 0.0, -0.75) * this->getScaling(), 2); 94 this->setEmissionPoint(Vector(4.1, -0.45, 0.0) * this->getScaling(), 3); 112 95 113 96 Animation3D* animation2 = this->getAnimation(WS_ACTIVATING, this); … … 140 123 pj->setVelocity(this->getParent()->getVelocity() + (tmp.getNormalized())*190); 141 124 142 pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor()); 125 pj->setAbsCoor(this->getEmissionPoint()); 126 //FIXME pj needs a absDir 143 127 // pj->setAbsDir(this->getAbsDir()); 144 128 // pj->setAbsDir(Quaternion(tmp.getNormalized(), this->getParent()->getAbsDir().apply(Vector(0,1,0)))); … … 146 130 pj->activate(); 147 131 148 this-> activeBarrel = (this->activeBarrel + 1) % this->getBarrels();132 this->cycleBarrel(); 149 133 } 150 134
Note: See TracChangeset
for help on using the changeset viewer.