Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 13, 2005, 4:50:55 PM (18 years ago)
Author:
bensch
Message:

orxonox/branches/world_entities: AimingTurrets zoom in to the selected Entities… looks quite good, if i may say so, but it is quite buggy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/world_entities/src/world_entities/weapons/aim.cc

    r5559 r5560  
    2323#include "list.h"
    2424#include "material.h"
     25#include "t_animation.h"
    2526
    2627#include "world_entity.h"
     
    6566  this->setBindNode(this);
    6667  this->material = new Material;
     68
     69  this->anim = new tAnimation<Aim>(this, &Aim::setSize);
     70  this->anim->setInfinity(ANIM_INF_CONSTANT);
     71  this->anim->addKeyFrame(500, .3, ANIM_LINEAR);
     72  this->anim->addKeyFrame(100, .2, ANIM_LINEAR);
     73  this->anim->addKeyFrame(50, .01, ANIM_LINEAR);
     74
    6775}
    6876
     
    8896  while (likely(entity != NULL))
    8997  {
    90     if (entity->isA(CL_NPC) && (source->getAbsCoor() - entity->getAbsCoor()).len() < 100)
     98    if (entity->isA(CL_NPC) &&(source->getAbsCoor() - entity->getAbsCoor()).len() < 100)
    9199    {
    92       this->setParent(entity);
     100      if (this->getParent() != entity)
     101      {
     102        this->anim->replay();
     103        this->setParent(entity);
     104      }
    93105      delete iterator;
    94106      return;
     
    159171void Aim::draw() const
    160172{
     173
    161174  glPushMatrix();
    162175  glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
Note: See TracChangeset for help on using the changeset viewer.