Changeset 5560 in orxonox.OLD for branches/world_entities/src/world_entities/weapons/aim.cc
- Timestamp:
- Nov 13, 2005, 4:50:55 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/world_entities/src/world_entities/weapons/aim.cc
r5559 r5560 23 23 #include "list.h" 24 24 #include "material.h" 25 #include "t_animation.h" 25 26 26 27 #include "world_entity.h" … … 65 66 this->setBindNode(this); 66 67 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 67 75 } 68 76 … … 88 96 while (likely(entity != NULL)) 89 97 { 90 if (entity->isA(CL_NPC) && 98 if (entity->isA(CL_NPC) &&(source->getAbsCoor() - entity->getAbsCoor()).len() < 100) 91 99 { 92 this->setParent(entity); 100 if (this->getParent() != entity) 101 { 102 this->anim->replay(); 103 this->setParent(entity); 104 } 93 105 delete iterator; 94 106 return; … … 159 171 void Aim::draw() const 160 172 { 173 161 174 glPushMatrix(); 162 175 glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
Note: See TracChangeset
for help on using the changeset viewer.