Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5576 in orxonox.OLD for branches/world_entities/src


Ignore:
Timestamp:
Nov 15, 2005, 11:21:57 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/world_entities: zoom only onto targets, that are in front of the Player… (cheap hack)

Location:
branches/world_entities/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/world_entities/src/lib/coord/p_node.h

    r5414 r5576  
    127127  static const char* parentingModeToChar(int parentingMode);
    128128  static PARENT_MODE charToParentingMode(const char* parentingMode);
     129
     130
    129131 private:
    130132  void init(PNode* parent);
  • branches/world_entities/src/world_entities/player.cc

    r5574 r5576  
    343343  Weapon* turret = NULL;
    344344
    345   printf("free slot: %d\n", this->weaponMan->getNextFreeSlot(3, WTYPE_TURRET | WTYPE_ALLDIRS));
    346 
    347345  if ((float)rand()/RAND_MAX < .1)
    348346  {
  • branches/world_entities/src/world_entities/weapons/aim.cc

    r5574 r5576  
    101101}
    102102
    103 void Aim::searchTarget(PNode* source)
     103void Aim::searchTarget(float range)
    104104{
    105105  tIterator<WorldEntity>* iterator = State::getWorldEntityList()->getIterator();
     
    107107  while (likely(entity != NULL))
    108108  {
    109     if (entity->isA(CL_NPC) && source->getAbsCoor().x < entity->getAbsCoor().x && (source->getAbsCoor() - entity->getAbsCoor()).len() < 100)
     109    if (entity->isA(CL_NPC) && this->source->getAbsCoor().x < entity->getAbsCoor().x && (this->source->getAbsCoor() - entity->getAbsCoor()).len() < range)
    110110    {
    111111      if (this->getParent() != entity)
     
    156156  this->text->setText(outputText);
    157157
     158
     159  if (this->source->getAbsCoor().x > this->getAbsCoor().x )
     160    this->searchTarget(1000);
    158161//   float z = 0.0f;
    159162//   glReadPixels ((int)this->getAbsCoor2D().x,
  • branches/world_entities/src/world_entities/weapons/aim.h

    r5567 r5576  
    3838  inline PNode* getTarget(PNode* target) { return this->getParent(); };
    3939
    40   void searchTarget(PNode* source);
     40  void searchTarget(float range);
    4141
    4242  void setSize(float size);
  • branches/world_entities/src/world_entities/weapons/aiming_turret.cc

    r5574 r5576  
    157157  pj->setAbsDir(this->getAbsDir());
    158158  pj->activate();
    159   this->target->searchTarget(this);
     159  this->target->searchTarget(100);
    160160}
    161161
  • branches/world_entities/src/world_entities/weapons/weapon_manager.cc

    r5574 r5576  
    472472        (this->currentSlotConfig[i].capability & capability & WTYPE_ALLKINDS) &&
    473473        (this->currentSlotConfig[i].capability & capability & WTYPE_ALLDIRS))
    474         {
    475         printf("%d %d %d %d\n", currentSlotConfig[i].capability, capability,  WTYPE_ALLKINDS, WTYPE_ALLDIRS);
    476 
    477474      return i;
    478       }
    479475  }
    480476  return -1;
Note: See TracChangeset for help on using the changeset viewer.