Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/world_entities/projectile.cc @ 3629

Last change on this file since 3629 was 3629, checked in by patrick, 19 years ago

orxonox/trunk: some changes in the storyentity framework: added a preLoad() function, since there is some stuff to be initialized before load(). written some comments to level loading doxygen stuff. now the worldinterface works

File size: 1.7 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
19#include "projectile.h"
20
21#include "world_entity.h"
22#include "objModel.h"
23#include "primitive.h"
24#include "vector.h"
25
26using namespace std;
27
28
29/**
30   \brief standard constructor
31*/
32Projectile::Projectile () : WorldEntity()
33{
34  //this->model = new OBJModel("");
35  this->projectileModel = new Primitive(P_SPHERE);
36}
37
38
39/**
40   \brief standard deconstructor
41*/
42Projectile::~Projectile () 
43{
44  /*
45     do not delete the test projectModel, since it is pnode
46     and will be cleaned out by world
47  */
48  //delete this->projectileModel;
49}
50
51
52/**
53   \brief signal tick, time dependent things will be handled here
54   \param time since last tick
55*/
56void Projectile::tick (float time) 
57{}
58
59/**
60   \brief the projectile gets hit by another entity
61   \param the other entity
62   \param place where it is hit
63*/
64void Projectile::hit (WorldEntity* entity, Vector* place) 
65{}
66
67
68/**
69   \brief the function gets called, when the projectile is destroyed
70*/
71void Projectile::destroy () 
72{}
73
74
75void Projectile::draw () 
76{
77  glMatrixMode(GL_MODELVIEW);
78  glPushMatrix();
79
80  float matrix[4][4]; 
81  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
82  this->getAbsDir().matrix (matrix);
83  glMultMatrixf((float*)matrix); 
84  //this->model->draw();
85  PRINTF(1)("draw draw draw draw draw draw \n");
86  this->projectileModel->draw();
87
88  glPopMatrix();
89}
90
Note: See TracBrowser for help on using the repository browser.