Changeset 5560 in orxonox.OLD for branches/world_entities/src
- Timestamp:
- Nov 13, 2005, 4:50:55 PM (19 years ago)
- 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 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); -
branches/world_entities/src/world_entities/weapons/aim.h
r5559 r5560 14 14 class Material; 15 15 class TiXmlElement; 16 template<class T> class tAnimation; 16 17 17 18 //! An Aim for zooming in on Targets. … … 41 42 Material* material; //!< a material for the Aim. 42 43 float rotationSpeed; //!< Speed of the Rotation. 44 tAnimation<Aim>* anim; 43 45 }; 44 46 -
branches/world_entities/src/world_entities/weapons/aiming_turret.cc
r5559 r5560 102 102 103 103 this->target = new Aim(); 104 this->target->setVisibility(false); 104 105 } 105 106 … … 112 113 void AimingTurret::activate() 113 114 { 115 this->target->setVisibility(true); 114 116 } 115 117 116 118 void AimingTurret::deactivate() 117 119 { 120 this->target->setVisibility(false); 118 121 } 119 122
Note: See TracChangeset
for help on using the changeset viewer.