Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 22, 2006, 9:36:55 AM (17 years ago)
Author:
nicolasc
Message:

defined emissionPoint as array, update get/set function, kept old as fallback

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/playability/src/world_entities/weapons/weapon.cc

    r10136 r10140  
    119119  }
    120120
    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  }
    125133
    126134  this->defaultTarget = NULL;                      //< Nothing is Targeted by default.
     
    154162  LoadParam(root, "projectile", this, Weapon, setProjectileTypeC)
    155163  .describe("Sets the name of the Projectile to load onto the Entity");
    156 
     164/*
    157165  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)");*/
    159167
    160168  LoadParam(root, "state-duration", this, Weapon, setStateDuration)
     
    253261 * @param point the Point relative to the mass-point of the Weapon
    254262 */
     263void Weapon::setEmissionPoint(const Vector& point, int barrel)
     264{
     265  this->emissionPoint[barrel]->setRelCoor(point);
     266}
     267
    255268void Weapon::setEmissionPoint(const Vector& point)
    256269{
    257   this->emissionPoint.setRelCoor(point);
    258 }
    259 
     270  this->emissionPoint[0]->setRelCoor(point);
     271}
    260272
    261273/**
Note: See TracChangeset for help on using the changeset viewer.