source:
orxonox.OLD/branches/ai/src/world_entities/npcs/npc_test.cc
@
10112
Last change on this file since 10112 was 10112, checked in by tfahrni, 17 years ago | |
---|---|
File size: 1.4 KB |
Rev | Line | |
---|---|---|
[1853] | 1 | |
2 | ||
[4597] | 3 | /* |
[1853] | 4 | orxonox - the future of 3D-vertical-scrollers |
5 | ||
6 | Copyright (C) 2004 orx | |
7 | ||
8 | This program is free software; you can redistribute it and/or modify | |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation; either version 2, or (at your option) | |
11 | any later version. | |
[1855] | 12 | |
13 | ### File Specific: | |
14 | main-programmer: Patrick Boenzli | |
15 | co-programmer: | |
[1853] | 16 | */ |
[5357] | 17 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY |
[1853] | 18 | |
19 | ||
[5682] | 20 | #include "npc_test.h" |
[1853] | 21 | |
[9947] | 22 | |
[4984] | 23 | #include "state.h" |
[5511] | 24 | #include "debug.h" |
[4984] | 25 | |
[9235] | 26 | #include "loading/factory.h" |
27 | #include "loading/load_param.h" | |
[5511] | 28 | |
[9947] | 29 | #include "md2/md2Model.h" |
30 | #include "player.h" | |
31 | #include "playable.h" | |
[1853] | 32 | |
[9869] | 33 | #include "class_id_DEPRECATED.h" |
[10112] | 34 | #include "movement_module.h" |
35 | #include "ai_module.h" | |
[10041] | 36 | |
[10112] | 37 | |
[9869] | 38 | ObjectListDefinitionID(NPC2, CL_NPC_TEST2); |
39 | CREATE_FACTORY(NPC2); | |
[1858] | 40 | |
[9947] | 41 | |
[10045] | 42 | NPC2::NPC2(const TiXmlElement* root) : NPC(NULL) |
[1931] | 43 | { |
[10112] | 44 | this->registerObject(this, NPC2::_objectList); |
45 | if (root != NULL)this->loadParams(root); | |
46 | ||
47 | this->aiModule=new MovementModule(this); | |
[1931] | 48 | } |
[1853] | 49 | |
[5034] | 50 | |
[5267] | 51 | NPC2::~NPC2 () |
[9869] | 52 | {} |
[1853] | 53 | |
[5267] | 54 | |
[9235] | 55 | void NPC2::loadParams(const TiXmlElement* root) |
56 | { | |
57 | NPC::loadParams(root); | |
58 | } | |
59 | ||
60 | ||
[9947] | 61 | |
62 | void NPC2::tick(float dt) | |
[9235] | 63 | { |
[10112] | 64 | // animating the md2 model |
[10071] | 65 | if( likely(this->getModel(0) != NULL) && this->getModel(0)->isA(MD2Model::staticClassID())) |
[10112] | 66 | ((MD2Model*)this->getModel(0))->tick(dt); |
67 | ||
68 | // processing AI | |
69 | //PRINTF(0)("Processing NPC\n"); | |
70 | if(this->aiModule!=NULL)this->aiModule->process(dt); | |
[4984] | 71 | } |
72 | ||
73 | ||
[5033] | 74 |
Note: See TracBrowser
for help on using the repository browser.