- Timestamp:
- Jan 28, 2007, 1:58:29 PM (18 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/npcs/npc.cc
r10406 r10439 34 34 #include "debug.h" 35 35 #include "loading/load_param.h" 36 #include "track/track.h" 36 37 37 38 … … 64 65 std::cout << "Swarm Number:" << swarmNumber << "\n"; 65 66 67 //add to track 68 if(this->entityTrack) 69 this->setParent(this->entityTrack->getTrackNode()); 70 else 66 71 AIEngine::getInstance()->addAI(teamNumber,swarmNumber,(WorldEntity*)this,maxSpeed,attackDistance); 67 72 … … 117 122 // this->getWeaponManager().getFixedTarget()->setRelCoor(100000,0,0); 118 123 124 125 126 119 127 } 120 128 … … 122 130 NPC::~NPC () 123 131 { 132 if(! this->entityTrack) 124 133 AIEngine::getInstance()->removeAI(teamNumber,swarmNumber,(WorldEntity*)this); 125 134 } … … 220 229 weaponMan.fire(); 221 230 this->bFire = false; 222 } 231 232 if(this->entityTrack) 233 this->entityTrack->tick(dt); 234 235 } -
trunk/src/world_entities/test_entity.cc
r10368 r10439 26 26 #include "debug.h" 27 27 28 #include "track/track.h" 29 28 30 29 31 … … 37 39 CREATE_FACTORY(TestEntity); 38 40 41 #include "script_class.h" 42 CREATE_SCRIPTABLE_CLASS(TestEntity, 43 addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX)) 44 ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY)) 45 ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ)) 46 ->addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor)) 47 ->addMethod("setAbsDir", Executor4<PNode, lua_State*,float,float,float,float>(&PNode::setAbsDir)) 48 ); 39 49 40 50 … … 53 63 TestEntity::TestEntity(const TiXmlElement* root) 54 64 { 55 this->init();56 57 65 if( root != NULL) 58 66 this->loadParams(root); 67 68 this->init(); 59 69 } 60 70 … … 74 84 this->registerObject(this, TestEntity::_objectList); 75 85 this->toList(OM_GROUP_00); 86 87 //add to track 88 if(this->entityTrack) 89 this->setParent(this->entityTrack->getTrackNode()); 90 76 91 } 77 92 … … 121 136 glPopMatrix(); 122 137 glPopAttrib(); 138 139 140 if( this->entityTrack != NULL) 141 this->entityTrack->drawGraph(); 142 123 143 } 124 144 … … 128 148 void TestEntity::tick (float time) 129 149 { 150 if(this->entityTrack) 151 this->entityTrack->tick(time); 130 152 131 153
Note: See TracChangeset
for help on using the changeset viewer.