Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/world_entities/npc.cc @ 4986

Last change on this file since 4986 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
RevLine 
[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"
22
[4984]23#include "state.h"
24
25
[1858]26using namespace std;
[1853]27
[1858]28
[4976]29NPC::NPC()
[1931]30{
[4597]31  this->setClassID(CL_NPC, "NPC");
[4976]32
[4982]33  this->loadModel("models/ships/bolido.obj");
[1931]34}
[1853]35
36NPC::~NPC () {}
37
38
[1858]39
[1931]40/* define the reaction, if the ship is been hit */
41int NPC::hit()
42{
43  die();
44  return 0;
45}
46
[4984]47void NPC::tick(float dt)
48{
[4986]49  Vector direction = (State::getCameraTarget()->getAbsCoor() - this->getAbsCoor());
[2036]50
[4986]51  //if (directin.len() < 100)
52  this->shiftCoor(direction *dt * 5 * exp(-direction.len()/30.0));
53
[4984]54}
55
56
[1931]57void NPC::die()
58{
59}
Note: See TracBrowser for help on using the repository browser.