Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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,
Note: See TracChangeset for help on using the changeset viewer.