Changeset 10702 in orxonox.OLD
- Timestamp:
- Jun 14, 2007, 11:23:51 PM (17 years ago)
- Location:
- branches/presentation/src/world_entities/weapons
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/presentation/src/world_entities/weapons/disruptor.cc
r10698 r10702 38 38 : Weapon() 39 39 { 40 // this->registerObject(this, Disruptor::_objectList);41 42 40 this->init(); 43 41 } … … 46 44 : Weapon() 47 45 { 48 // this->registerObject(this, Disruptor::_objectList);49 50 46 // TODO add leftRight to params 51 47 this->init(); … … 68 64 delete [] this->shootAnim; 69 65 delete [] this->objComp; 70 /* 71 for(int j = 0; j < this->getSegs(); j++) 72 { 73 delete this->shootAnim[i][j]; 74 delete this->objComp[i][j]; 75 } 76 delete this->shootAnim[i]; 77 delete this->objComp[i]; 78 delete this->emissionPoint[i]; 79 }*/ 80 81 // this->deconstr(); 82 // model will be deleted from WorldEntity-destructor 66 83 67 } 84 68 … … 198 182 void Disruptor::draw() const 199 183 { 200 glMatrixMode(GL_MODELVIEW);201 184 glPushMatrix(); 202 glTranslatef (this->getAbsCoor ().x, 203 this->getAbsCoor ().y, 204 this->getAbsCoor ().z); 205 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 206 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 207 208 //Base 209 static_cast<StaticModel*>(this->getModel())->draw(1); 210 211 // Barrel glPushMatrix(); 212 glTranslatef 213 (this->objComp[0][0]->getAbsCoor().x, this->objComp[0][0]->getAbsCoor().y, this->objComp[0][0]->getAbsCoor().z); 214 static_cast<StaticModel*>(this->getModel())->draw(0); 185 glMatrixMode(GL_MODELVIEW); 186 glTranslatef (this->getAbsCoor ().x, 187 this->getAbsCoor ().y, 188 this->getAbsCoor ().z); 189 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 190 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 191 192 //Base 193 static_cast<StaticModel*>(this->getModel())->draw(1); 194 195 // Barrel 196 glPushMatrix(); 197 glTranslatef(this->objComp[0][0]->getAbsCoor().x, this->objComp[0][0]->getAbsCoor().y, this->objComp[0][0]->getAbsCoor().z); 198 static_cast<StaticModel*>(this->getModel())->draw(0); 199 glPopMatrix(); 215 200 glPopMatrix(); 216 201 } -
branches/presentation/src/world_entities/weapons/nadion_laser.cc
r10698 r10702 88 88 89 89 this->setCapability(WTYPE_ALLDIRS | WTYPE_DIRECTIONAL | WTYPE_LIGHT); 90 this->setProjectileTypeC("NadionBlast"); // FIXME temp projectile, until nadion_laser_bolt exists.90 this->setProjectileTypeC("NadionBlast"); 91 91 this->prepareProjectiles(20); 92 92 … … 167 167 void NadionLaser::draw() const 168 168 { 169 glPushMatrix(); 169 170 glMatrixMode(GL_MODELVIEW); 170 glPushMatrix();171 171 glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); 172 172 Vector tmpRot = this->getAbsDir().getSpacialAxis(); 173 173 glRotatef (this->getAbsDir().getSpacialAxisAngle(), tmpRot.x, tmpRot.y, tmpRot.z ); 174 174 static_cast<StaticModel*>(this->getModel())->draw(); 175 176 177 175 glPopMatrix(); 178 176 } -
branches/presentation/src/world_entities/weapons/rf_cannon.cc
r10701 r10702 126 126 void RFCannon::fire() 127 127 { 128 // for (int i = 0; i < this->getBarrels(); i++){ 129 Projectile* pj = this->getProjectile(); 130 if (pj == NULL) 131 return; 128 Projectile* pj = this->getProjectile(); 129 if (pj == NULL) 130 return; 132 131 133 134 132 // set the owner 133 pj->setOwner(this->getOwner()); 135 134 136 135 pj->setParent(PNode::getNullParent()); 137 136 138 137 pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*190); 139 138 140 141 142 139 pj->setAbsCoor(this->emissionPoint[this->activeBarrel]->getAbsCoor()); 140 pj->setAbsDir(this->getAbsDir()); 141 pj->activate(); 143 142 144 this->activeBarrel = (this->activeBarrel + 1) % this->getBarrels(); 145 // } 143 this->activeBarrel = (this->activeBarrel + 1) % this->getBarrels(); 146 144 } 147 145 … … 162 160 void RFCannon::draw() const 163 161 { 164 glMatrixMode(GL_MODELVIEW);165 162 glPushMatrix(); 163 glMatrixMode(GL_MODELVIEW); 166 164 glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); 167 165 Vector tmpRot = this->getAbsDir().getSpacialAxis();
Note: See TracChangeset
for help on using the changeset viewer.