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