Changeset 10140 in orxonox.OLD for branches/playability/src/world_entities
- Timestamp:
- Dec 22, 2006, 9:36:55 AM (18 years ago)
- Location:
- branches/playability/src/world_entities/weapons
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/playability/src/world_entities/weapons/heavy_blaster.cc
r10136 r10140 122 122 animation3->setInfinity(ANIM_INF_CONSTANT); 123 123 124 this->setEmissionPoint(3.8, 1.2, 0 );124 this->setEmissionPoint(3.8, 1.2, 0, 0); 125 125 126 126 animation2->addKeyFrame(Vector(0.0, -1.0, 0.0), Quaternion(), 0.3, ANIM_LINEAR, ANIM_NULL); … … 147 147 pj->setVelocity(this->getAbsDir().apply(Vector(1,0,0))*130 + VECTOR_RAND(1)); 148 148 149 pj->setAbsCoor(this->getEmissionPoint( ));149 pj->setAbsCoor(this->getEmissionPoint(0)); 150 150 pj->setAbsDir(this->getAbsDir()); 151 151 pj->toList(OM_GROUP_01_PROJ); -
branches/playability/src/world_entities/weapons/weapon.cc
r10136 r10140 119 119 } 120 120 121 this->soundSource = new OrxSound::SoundSource(this); //< Every Weapon has exacty one SoundSource. 122 this->emissionPoint.setParent(this); //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles 123 this->emissionPoint.setName("EmissionPoint"); 124 this->emissionPoint.addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT); 121 this->soundSource = new OrxSound::SoundSource(this); //< Every Weapon has exacty one SoundSource 122 123 this->barrels = 1; 124 this->segs = 1; 125 126 this->emissionPoint = new PNode*[this->barrels]; 127 for(int i = 0; i < this->barrels; i++){ 128 this->emissionPoint[i] = new PNode; 129 this->emissionPoint[i]->setParent(this); //< One EmissionPoint, that is a PNode connected to the weapon. You can set this to the exitting point of the Projectiles 130 this->emissionPoint[i]->setName("EmissionPoint"); 131 this->emissionPoint[i]->addNodeFlags(PNODE_PROHIBIT_DELETE_WITH_PARENT); 132 } 125 133 126 134 this->defaultTarget = NULL; //< Nothing is Targeted by default. … … 154 162 LoadParam(root, "projectile", this, Weapon, setProjectileTypeC) 155 163 .describe("Sets the name of the Projectile to load onto the Entity"); 156 164 /* 157 165 LoadParam(root, "emission-point", this, Weapon, setEmissionPoint) 158 .describe("Sets the Point of emission of this weapon ");166 .describe("Sets the Point of emission of this weapon (1: EmmsionVector; 2: EmissionPoint)");*/ 159 167 160 168 LoadParam(root, "state-duration", this, Weapon, setStateDuration) … … 253 261 * @param point the Point relative to the mass-point of the Weapon 254 262 */ 263 void Weapon::setEmissionPoint(const Vector& point, int barrel) 264 { 265 this->emissionPoint[barrel]->setRelCoor(point); 266 } 267 255 268 void Weapon::setEmissionPoint(const Vector& point) 256 269 { 257 this->emissionPoint.setRelCoor(point); 258 } 259 270 this->emissionPoint[0]->setRelCoor(point); 271 } 260 272 261 273 /** -
branches/playability/src/world_entities/weapons/weapon.h
r10136 r10140 140 140 141 141 // EMISSION 142 /** keeping old functions*/ 143 void setEmissionPoint(const Vector& point, int barrel); 142 144 void setEmissionPoint(const Vector& point); 143 145 /** @see void setEmissionPoint(const Vector& point); */ 146 inline void setEmissionPoint(float x, float y, float z, int barrel) { this->setEmissionPoint(Vector(x, y, z), barrel); }; 144 147 inline void setEmissionPoint(float x, float y, float z) { this->setEmissionPoint(Vector(x, y, z)); }; 145 148 /** @returns the absolute Position of the EmissionPoint */ 146 inline const Vector& getEmissionPoint() const { return this->emissionPoint.getAbsCoor(); }; 149 inline const Vector& getEmissionPoint(int barrel) const { return this->emissionPoint[barrel]->getAbsCoor(); }; 150 inline const Vector& getEmissionPoint() const { return this->emissionPoint[0]->getAbsCoor(); }; 151 147 152 148 153 inline void setDefaultTarget(PNode* defaultTarget) { this->defaultTarget = defaultTarget; }; … … 253 258 OrxSound::SoundBuffer soundBuffers[WA_ACTION_COUNT]; //!< SoundBuffers for all actions @see WeaponAction. 254 259 255 PNode 260 PNode** emissionPoint; //!< The point, where the projectiles are emitted. (this is coppled with the Weapon by default) 256 261 257 262 bool hideInactive; //!< Hides the Weapon if it is inactive
Note: See TracChangeset
for help on using the changeset viewer.