Last change
on this file since 5029 was
5029,
checked in by patrick, 19 years ago
|
orxonox/trunk: some changes in the NPC interface class
|
File size:
887 bytes
|
Line | |
---|
1 | |
---|
2 | |
---|
3 | /* |
---|
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. |
---|
12 | |
---|
13 | ### File Specific: |
---|
14 | main-programmer: Patrick Boenzli |
---|
15 | co-programmer: |
---|
16 | */ |
---|
17 | |
---|
18 | |
---|
19 | //#include "ai.h" |
---|
20 | |
---|
21 | #include "npc.h" |
---|
22 | |
---|
23 | #include "state.h" |
---|
24 | |
---|
25 | |
---|
26 | using namespace std; |
---|
27 | |
---|
28 | |
---|
29 | NPC::NPC() |
---|
30 | { |
---|
31 | this->setClassID(CL_NPC, "NPC"); |
---|
32 | |
---|
33 | this->loadModel("models/ships/bolido.obj"); |
---|
34 | } |
---|
35 | |
---|
36 | NPC::~NPC () {} |
---|
37 | |
---|
38 | |
---|
39 | void NPC::collidesWith(WorldEntity* entity, const Vector& location) |
---|
40 | { |
---|
41 | |
---|
42 | } |
---|
43 | |
---|
44 | |
---|
45 | void NPC::tick(float dt) |
---|
46 | { |
---|
47 | Vector direction = (State::getCameraTarget()->getAbsCoor() - this->getAbsCoor()); |
---|
48 | |
---|
49 | //if (directin.len() < 100) |
---|
50 | this->shiftCoor(direction *dt * 5 * exp(-direction.len()/30.0)); |
---|
51 | |
---|
52 | } |
---|
53 | |
---|
54 | |
---|
Note: See
TracBrowser
for help on using the repository browser.