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