source:
orxonox.OLD/orxonox/trunk/src/world_entities/npc.cc
@
5033
Last change on this file since 5033 was 5033, checked in by patrick, 19 years ago | |
---|---|
File size: 1.0 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 | */ |
17 | ||
18 | ||
[4977] | 19 | //#include "ai.h" |
[2036] | 20 | |
[1853] | 21 | #include "npc.h" |
[5033] | 22 | #include "obb_tree.h" |
[1853] | 23 | |
[4984] | 24 | #include "state.h" |
25 | ||
26 | ||
[1858] | 27 | using namespace std; |
[1853] | 28 | |
[1858] | 29 | |
[4976] | 30 | NPC::NPC() |
[1931] | 31 | { |
[4597] | 32 | this->setClassID(CL_NPC, "NPC"); |
[4976] | 33 | |
[4982] | 34 | this->loadModel("models/ships/bolido.obj"); |
[5033] | 35 | if(this->obbTree == NULL) |
36 | this->obbTree = new OBBTree(5, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount()); | |
[1931] | 37 | } |
[1853] | 38 | |
39 | NPC::~NPC () {} | |
40 | ||
41 | ||
[5029] | 42 | void NPC::collidesWith(WorldEntity* entity, const Vector& location) |
43 | { | |
[1858] | 44 | |
[1931] | 45 | } |
46 | ||
[5029] | 47 | |
[4984] | 48 | void NPC::tick(float dt) |
49 | { | |
[4986] | 50 | Vector direction = (State::getCameraTarget()->getAbsCoor() - this->getAbsCoor()); |
[2036] | 51 | |
[4986] | 52 | //if (directin.len() < 100) |
53 | this->shiftCoor(direction *dt * 5 * exp(-direction.len()/30.0)); | |
54 | ||
[4984] | 55 | } |
56 | ||
57 | ||
[5033] | 58 |
Note: See TracBrowser
for help on using the repository browser.