Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

Last change on this file since 4976 was 4976, checked in by bensch, 19 years ago

orxonox/trunk: flotilia

File size: 1.0 KB
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#include <iostream>
19#include <GL/glut.h>
20
21#include "ai.h"
22
23#include "npc.h"
24
25using namespace std;
26
27
28NPC::NPC()
29{
30  this->setClassID(CL_NPC, "NPC");
31  hasDied = 0;
32
33  this->loadModel("models/bolido.obj");
34}
35
36NPC::~NPC () {}
37
38
39void NPC::setPosition(float x, float y, float z)
40{
41  xCor = x; yCor = y; zCor = z;
42}
43
44void NPC::getPosition(float* x, float* y, float* z)
45{
46  *x = xCor;
47  *y = yCor;
48  *z = zCor;
49}
50
51void NPC::setCollisionRadius(float r)
52{
53  collisionRadius = r;
54}
55
56float NPC::getCollisionRadius()
57{
58  return collisionRadius;
59}
60
61
62
63/* define the reaction, if the ship is been hit */
64int NPC::hit()
65{
66  die();
67  return 0;
68}
69
70
71void NPC::die()
72{
73  hasDied = 1;
74}
Note: See TracBrowser for help on using the repository browser.