Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5560 in orxonox.OLD for branches


Ignore:
Timestamp:
Nov 13, 2005, 4:50:55 PM (19 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

Location:
branches/world_entities/src/world_entities/weapons
Files:
3 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);
  • branches/world_entities/src/world_entities/weapons/aim.h

    r5559 r5560  
    1414class Material;
    1515class TiXmlElement;
     16template<class T> class tAnimation;
    1617
    1718//! An Aim for zooming in on Targets.
     
    4142   Material*        material;             //!< a material for the Aim.
    4243   float            rotationSpeed;        //!< Speed of the Rotation.
     44   tAnimation<Aim>* anim;
    4345};
    4446
  • branches/world_entities/src/world_entities/weapons/aiming_turret.cc

    r5559 r5560  
    102102
    103103  this->target = new Aim();
     104  this->target->setVisibility(false);
    104105}
    105106
     
    112113void AimingTurret::activate()
    113114{
     115  this->target->setVisibility(true);
    114116}
    115117
    116118void AimingTurret::deactivate()
    117119{
     120  this->target->setVisibility(false);
    118121}
    119122
Note: See TracChangeset for help on using the changeset viewer.