Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

WorldEntities: Addes files for a bomb class

File size: 1.9 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
18using namespace std;
19
20
21/**
22 * constructs and loads a Bomb from a XML-element
23 * @param root the XML-element to load from
24 */
25Bomb::Bomb(const TiXmlElement* root)
26{
27  this->init();
28  if (root != NULL)
29    this->loadParams(root);
30}
31
32
33/**
34 * standard deconstructor
35 */
36Bomb::~Bomb ()
37{
38
39}
40
41
42/**
43 * initializes the Bomb
44 * @todo change this to what you wish
45 */
46void Bomb::init()
47{
48  this->setClassID(CL_PROTO_WORLD_ENTITY, "Bomb");
49
50  /**
51   * @todo: Write CL_PROTO_WORLD_ENTITY INTO THE src/defs/class_id.h (your own definition)
52   */
53
54}
55
56
57/**
58 * loads a Bomb from a XML-element
59 * @param root the XML-element to load from
60 * @todo make the class Loadable
61 */
62void Bomb::loadParams(const TiXmlElement* root)
63{
64  // all the clases this Entity is directly derived from must be called in this way, to load all settings.
65  static_cast<WorldEntity*>(this)->loadParam(root);
66
67
68  /**
69   * @todo: make the class Loadable
70   */
71}
72
73
74/**
75 * advances the Bomb about time seconds
76 * @param time the Time to step
77 */
78Bomb::tick(float time)
79{
80
81}
82
83/**
84 * draws this worldEntity
85 */
86void Bomb::draw () const
87{
88  glMatrixMode(GL_MODELVIEW);
89  glPushMatrix();
90  float matrix[4][4];
91
92  /* translate */
93  glTranslatef (this->getAbsCoor ().x,
94                this->getAbsCoor ().y,
95                this->getAbsCoor ().z);
96  /* rotate */
97  this->getAbsDir().matrix(matrix);
98  glMultMatrixf((float*)matrix);
99
100  if (model)
101    model->draw();
102  glPopMatrix();
103}
104
105
106/**
107 *
108 *
109 */
110void Bomb::collidesWith (WorldEntity* entity, const Vector& location)
111{
112
113}
Note: See TracBrowser for help on using the repository browser.