1 | /* |
---|
2 | orxonox - the future of 3D-vertical-scrollers |
---|
3 | |
---|
4 | Copyright (C) 2004 orx |
---|
5 | |
---|
6 | This program is free software; you can redistribute it and/or modify |
---|
7 | it under the terms of the GNU General Public License as published by |
---|
8 | the Free Software Foundation; either version 2, or (at your option) |
---|
9 | any later version. |
---|
10 | |
---|
11 | ### File Specific: |
---|
12 | main-programmer: Thomas Fahrni |
---|
13 | co-programmer: |
---|
14 | */ |
---|
15 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_AI |
---|
16 | |
---|
17 | #include "movement_module.h" |
---|
18 | #include "ai_engine.h" |
---|
19 | #include "state.h" |
---|
20 | #include "debug.h" |
---|
21 | |
---|
22 | //class AIEngine; |
---|
23 | |
---|
24 | MovementModule::MovementModule(){ |
---|
25 | //std::cout << "MovementModule created...\n"; |
---|
26 | } |
---|
27 | |
---|
28 | MovementModule::~MovementModule(){ |
---|
29 | } |
---|
30 | |
---|
31 | |
---|
32 | void MovementModule::process() |
---|
33 | { |
---|
34 | //float dt=AIEngine::getInstance()->dtS; |
---|
35 | std::cout << "///////////////////Processing Movement Module/////////////////////\n"; |
---|
36 | |
---|
37 | //How does the Module know the AITeamMember it belongs to?? |
---|
38 | //partialy solved... |
---|
39 | /* |
---|
40 | Vector absPosition = owner->getAbsCoor(); |
---|
41 | |
---|
42 | PRINTF(0)(" npc abs coor: %f, %f, %f\n", absPosition.x, absPosition.y, absPosition.z); |
---|
43 | |
---|
44 | //Player* pl = State::getPlayer(); |
---|
45 | /*Vector playerAbsPos = pl->getPlayable()->getAbsCoor(); |
---|
46 | |
---|
47 | //PRINTF(0)(" player abs coor: %f, %f, %f\n", playerAbsPos.x, playerAbsPos.y, playerAbsPos.z); |
---|
48 | |
---|
49 | |
---|
50 | // intelligent reaction |
---|
51 | |
---|
52 | Vector distanceVector = playerAbsPos - absPosition; |
---|
53 | distanceVector.normalize(); |
---|
54 | |
---|
55 | float speed = 10.0f; |
---|
56 | |
---|
57 | owner->shiftCoor( distanceVector * speed * dt);*/ |
---|
58 | } |
---|
59 | |
---|
60 | |
---|