Changeset 10771 in orxonox.OLD for branches/presentation/src/world_entities/weapons/weapon.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/weapon.cc
r10698 r10771 62 62 if (OrxSound::SoundSource::objectList().exists(this->soundSource)) 63 63 delete this->soundSource; 64 65 // for (int i = 0; i < MAX_BARRELS; i++) 66 // { 67 // delete [] this->shootAnim[i]; 68 // delete [] this->objComp[i]; 69 // } 70 // delete [] this->emissionPoint; 71 // delete [] this->shootAnim; 72 // delete [] this->objComp; 73 64 74 } 65 75 … … 121 131 this->soundSource = new OrxSound::SoundSource(this); //< Every Weapon has exacty one SoundSource 122 132 123 this->barrels = 1; 133 this->barrels = 1; // just to have an initial value 124 134 this->segs = 1; 135 this->activeBarrel = 0; 125 136 126 137 this->preferedSide = -1; 127 138 this->preferedSlot = -1; 128 129 this->shootAnim = new Animation3D**[this->getBarrels()]; 130 for (int i = 0; i < this->getBarrels(); i++) 131 this->shootAnim[i] = new Animation3D* [this->getSegs()]; 132 133 this->emissionPoint = new PNode*[this->barrels]; 134 for(int i = 0; i < this->barrels; i++){ 139 this->side = -1; 140 141 //!< forward initialisation of animation and emissionpoints 142 for (int i = 0; i < MAX_BARRELS; i++){ 135 143 this->emissionPoint[i] = new PNode; 136 144 this->emissionPoint[i]->setParent(this); //Parenting emissionPoint to Weapons 137 145 this->emissionPoint[i]->setName("EmissionPoint"); 138 146 this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT); 147 for(int j = 0; j < MAX_SEGMENTS; j++) 148 { 149 this->objComp[i][j] = new PNode; 150 this->shootAnim[i][j] = new Animation3D(this->objComp[i][j]); 151 this->shootAnim[i][j]->setInfinity(ANIM_INF_CONSTANT); 152 } 139 153 } 140 154 … … 149 163 this->maxCharge = 1.0; //< The maximum charge is also one unit. 150 164 151 this->energy = 10 ; //< The secondary Buffer (before we have to reload)165 this->energy = 10.0; //< The secondary Buffer (before we have to reload) 152 166 this->energyMax = 10.0; //< How much energy can be carried 153 167 this->capability = WTYPE_ALL; //< The Weapon has all capabilities @see W_Capability. … … 176 190 LoadParam(root, "slot", this, Weapon, setPreferedSlot) 177 191 .describe("slot this weapon will be added"); 178 /*179 LoadParam(root, "emission-point", this, Weapon, setEmissionPoint)180 .describe("Sets the Point of emission of this weapon (1: EmmsionVector; 2: EmissionPoint)");*/181 192 182 193 LoadParam(root, "state-duration", this, Weapon, setStateDuration) … … 274 285 * sets the emissionPoint's relative position from the Weapon 275 286 * @param point the Point relative to the mass-point of the Weapon 287 * @param barrel (optional) define a specific barrel, default = 0 276 288 */ 277 289 void Weapon::setEmissionPoint(const Vector& point, int barrel) … … 280 292 } 281 293 282 void Weapon::setEmissionPoint(const Vector& point)283 {284 this->emissionPoint[0]->setRelCoor(point);285 }294 // void Weapon::setEmissionPoint(const Vector& point) 295 // { 296 // this->emissionPoint[0]->setRelCoor(point); 297 // } 286 298 287 299 /**
Note: See TracChangeset
for help on using the changeset viewer.