Changeset 5567 in orxonox.OLD for branches/world_entities/src/world_entities/weapons/aim.cc
- Timestamp:
- Nov 15, 2005, 2:32:27 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/world_entities/src/world_entities/weapons/aim.cc
r5560 r5567 24 24 #include "material.h" 25 25 #include "t_animation.h" 26 #include "text.h" 26 27 27 28 #include "world_entity.h" … … 33 34 * standart constructor 34 35 */ 35 Aim::Aim ( const TiXmlElement* root)36 Aim::Aim (PNode* source, const TiXmlElement* root) 36 37 { 37 38 this->init(); 39 40 this->source = source; 38 41 39 42 if (root) … … 50 53 if (this->material) 51 54 delete this->material; 55 56 if (this->text != NULL) 57 delete this->text; 52 58 } 53 59 … … 66 72 this->setBindNode(this); 67 73 this->material = new Material; 74 this->source = NULL; 68 75 69 76 this->anim = new tAnimation<Aim>(this, &Aim::setSize); … … 73 80 this->anim->addKeyFrame(50, .01, ANIM_LINEAR); 74 81 75 } 76 82 this->text = new Text(); 83 this->text->setParent2D(this); 84 this->text->setRelCoor2D(10, -50); 85 this->text->setParentMode2D(E2D_PARENT_MOVEMENT); 86 this->text->setText("Testing"); 87 } 77 88 78 89 void Aim::loadParams(const TiXmlElement* root) … … 101 112 { 102 113 this->anim->replay(); 103 this->setParent (entity);114 this->setParentSoft(entity, 3); 104 115 } 105 116 delete iterator; … … 141 152 this->shiftDir2D(dt * rotationSpeed); 142 153 154 char outputText[100]; 155 sprintf(outputText, "distance: %f\n", (this->source->getAbsCoor() - this->getAbsCoor()).len()); 156 this->text->setText(outputText); 143 157 144 158 // float z = 0.0f;
Note: See TracChangeset
for help on using the changeset viewer.