Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/world_entities/src/world_entities/weapons/bomb.cc @ 5603

Last change on this file since 5603 was 5603, checked in by stefalie, 18 years ago

WorldEntities: Fixed bugs in bomb class

File size: 2.1 KB
Line 
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"
17#include "glincl.h"
18#include "model.h"
19#include "fast_factory.h"
20
21using namespace std;
22
23CREATE_FAST_FACTORY_STATIC(Bomb, CL_BOMB);
24
25/**
26 * constructs and loads a Bomb from a XML-element
27 * @param root the XML-element to load from
28 */
29Bomb::Bomb(const TiXmlElement* root)
30{
31  this->init();
32  if (root != NULL)
33    this->loadParams(root);
34}
35
36
37/**
38 * standard deconstructor
39 */
40Bomb::~Bomb ()
41{
42
43}
44
45
46/**
47 * initializes the Bomb
48 * @todo change this to what you wish
49 */
50void Bomb::init()
51{
52  this->setClassID(CL_BOMB, "Bomb");
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 */
66void 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.
69  static_cast<WorldEntity*>(this)->loadParams(root);
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 */
82void Bomb::tick(float time)
83{
84
85}
86
87/**
88 * draws this worldEntity
89 */
90void 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 */
114void Bomb::collidesWith (WorldEntity* entity, const Vector& location)
115{
116
117}
118
119void Bomb::activate()
120{
121
122}
123
124void Bomb::deactivate()
125{
126
127}
Note: See TracBrowser for help on using the repository browser.