Last change
on this file since 5012 was
4986,
checked in by bensch, 19 years ago
|
orxonox/trunk: moved the camera around, so now you have the sight from within the cockpit on '2'
|
File size:
925 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 | |
---|
40 | /* define the reaction, if the ship is been hit */ |
---|
41 | int NPC::hit() |
---|
42 | { |
---|
43 | die(); |
---|
44 | return 0; |
---|
45 | } |
---|
46 | |
---|
47 | void NPC::tick(float dt) |
---|
48 | { |
---|
49 | Vector direction = (State::getCameraTarget()->getAbsCoor() - this->getAbsCoor()); |
---|
50 | |
---|
51 | //if (directin.len() < 100) |
---|
52 | this->shiftCoor(direction *dt * 5 * exp(-direction.len()/30.0)); |
---|
53 | |
---|
54 | } |
---|
55 | |
---|
56 | |
---|
57 | void NPC::die() |
---|
58 | { |
---|
59 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.