[5590] | 1 | /* |
---|
| 2 | orxonox - the future of 3D-vertical-scrollers |
---|
| 3 | |
---|
| 4 | Copyright (C) 2004 orx |
---|
| 5 | |
---|
| 6 | This program is free software; you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 9 | any later version. |
---|
| 10 | |
---|
| 11 | ### File Specific: |
---|
| 12 | main-programmer: Stefan Lienhard |
---|
| 13 | co-programmer: ... |
---|
| 14 | */ |
---|
| 15 | |
---|
| 16 | #include "bomb.h" |
---|
[5603] | 17 | #include "glincl.h" |
---|
| 18 | #include "model.h" |
---|
| 19 | #include "fast_factory.h" |
---|
[5590] | 20 | |
---|
| 21 | using namespace std; |
---|
| 22 | |
---|
[5603] | 23 | CREATE_FAST_FACTORY_STATIC(Bomb, CL_BOMB); |
---|
[5590] | 24 | |
---|
| 25 | /** |
---|
| 26 | * constructs and loads a Bomb from a XML-element |
---|
| 27 | * @param root the XML-element to load from |
---|
| 28 | */ |
---|
| 29 | Bomb::Bomb(const TiXmlElement* root) |
---|
| 30 | { |
---|
| 31 | this->init(); |
---|
| 32 | if (root != NULL) |
---|
| 33 | this->loadParams(root); |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | /** |
---|
| 38 | * standard deconstructor |
---|
| 39 | */ |
---|
| 40 | Bomb::~Bomb () |
---|
| 41 | { |
---|
| 42 | |
---|
| 43 | } |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | /** |
---|
| 47 | * initializes the Bomb |
---|
| 48 | * @todo change this to what you wish |
---|
| 49 | */ |
---|
| 50 | void Bomb::init() |
---|
| 51 | { |
---|
[5603] | 52 | this->setClassID(CL_BOMB, "Bomb"); |
---|
[5590] | 53 | |
---|
| 54 | /** |
---|
| 55 | * @todo: Write CL_PROTO_WORLD_ENTITY INTO THE src/defs/class_id.h (your own definition) |
---|
| 56 | */ |
---|
| 57 | |
---|
| 58 | } |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | /** |
---|
| 62 | * loads a Bomb from a XML-element |
---|
| 63 | * @param root the XML-element to load from |
---|
| 64 | * @todo make the class Loadable |
---|
| 65 | */ |
---|
| 66 | void Bomb::loadParams(const TiXmlElement* root) |
---|
| 67 | { |
---|
| 68 | // all the clases this Entity is directly derived from must be called in this way, to load all settings. |
---|
[5603] | 69 | static_cast<WorldEntity*>(this)->loadParams(root); |
---|
[5590] | 70 | |
---|
| 71 | |
---|
| 72 | /** |
---|
| 73 | * @todo: make the class Loadable |
---|
| 74 | */ |
---|
| 75 | } |
---|
| 76 | |
---|
| 77 | |
---|
| 78 | /** |
---|
| 79 | * advances the Bomb about time seconds |
---|
| 80 | * @param time the Time to step |
---|
| 81 | */ |
---|
[5603] | 82 | void Bomb::tick(float time) |
---|
[5590] | 83 | { |
---|
| 84 | |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | /** |
---|
| 88 | * draws this worldEntity |
---|
| 89 | */ |
---|
| 90 | void Bomb::draw () const |
---|
| 91 | { |
---|
| 92 | glMatrixMode(GL_MODELVIEW); |
---|
| 93 | glPushMatrix(); |
---|
| 94 | float matrix[4][4]; |
---|
| 95 | |
---|
| 96 | /* translate */ |
---|
| 97 | glTranslatef (this->getAbsCoor ().x, |
---|
| 98 | this->getAbsCoor ().y, |
---|
| 99 | this->getAbsCoor ().z); |
---|
| 100 | /* rotate */ |
---|
| 101 | this->getAbsDir().matrix(matrix); |
---|
| 102 | glMultMatrixf((float*)matrix); |
---|
| 103 | |
---|
| 104 | if (model) |
---|
| 105 | model->draw(); |
---|
| 106 | glPopMatrix(); |
---|
| 107 | } |
---|
| 108 | |
---|
| 109 | |
---|
| 110 | /** |
---|
| 111 | * |
---|
| 112 | * |
---|
| 113 | */ |
---|
| 114 | void Bomb::collidesWith (WorldEntity* entity, const Vector& location) |
---|
| 115 | { |
---|
| 116 | |
---|
| 117 | } |
---|
[5603] | 118 | |
---|
| 119 | void Bomb::activate() |
---|
| 120 | { |
---|
| 121 | |
---|
| 122 | } |
---|
| 123 | |
---|
| 124 | void Bomb::deactivate() |
---|
| 125 | { |
---|
| 126 | |
---|
| 127 | } |
---|