Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/weapons/ground_turret.cc @ 5776

Last change on this file since 5776 was 5750, checked in by bensch, 19 years ago

orxonox/trunk: merged the WorldEntities into the Trunk.
Merged with command:
svn merge branches/world_entities/ trunk/ -r5516:HEAD

conflics from world_entities changed in favor of branches/world_entity
all other conflict in favor of the trunk

File size: 2.4 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: Manuel Leuenberger
13   co-programmer: ...
14*/
15
16#include "ground_turret.h"
17#include "factory.h"
18#include "model.h"
19#include "turret.h"
20
21CREATE_FACTORY(GroundTurret, CL_GROUND_TURRET);
22
23using namespace std;
24
25
26/**
27 * constructs and loads a GroundTurret from a XML-element
28 * @param root the XML-element to load from
29 */
30GroundTurret::GroundTurret(const TiXmlElement* root)
31{
32  this->init();
33  if (root != NULL)
34    this->loadParams(root);
35}
36
37
38/**
39 * standard deconstructor
40 */
41GroundTurret::~GroundTurret ()
42{
43
44}
45
46
47/**
48 * initializes the GroundTurret
49 * @todo change this to what you wish
50 */
51void GroundTurret::init()
52{
53  this->setClassID(CL_GROUND_TURRET, "GroundTurret");
54  this->loadModel("models/ground_turret.obj", 5);
55  left = new Turret();
56  left->setParent(this);
57  left->setRelCoor(0,10,0);
58  right = new Turret();
59  right->setParent(this);
60  right->setRelCoor(0,10,0);
61}
62
63
64/**
65 * loads a GroundTurret from a XML-element
66 * @param root the XML-element to load from
67 * @todo make the class Loadable
68 */
69void GroundTurret::loadParams(const TiXmlElement* root)
70{
71  // all the clases this Entity is directly derived from must be called in this way, to load all settings.
72  static_cast<NPC*>(this)->loadParams(root);
73
74
75  /**
76   * @todo: make the class Loadable
77   */
78}
79
80
81/**
82 * advances the GroundTurret about time seconds
83 * @param time the Time to step
84 */
85void GroundTurret::tick(float time)
86{
87
88}
89
90/**
91 * draws this worldEntity
92 */
93void GroundTurret::draw () const
94{
95  glMatrixMode(GL_MODELVIEW);
96  glPushMatrix();
97  float matrix[4][4];
98
99  /* translate */
100  glTranslatef (this->getAbsCoor ().x,
101                this->getAbsCoor ().y,
102                this->getAbsCoor ().z);
103  /* rotate */
104  this->getAbsDir().matrix(matrix);
105  glMultMatrixf((float*)matrix);
106
107  if (model)
108    model->draw();
109  //left->draw();
110  //right->draw();
111  glPopMatrix();
112}
113
114
115/**
116 *
117 *
118 */
119void GroundTurret::collidesWith (WorldEntity* entity, const Vector& location)
120{
121
122}
123
124/**
125 *
126 *
127 */
128void GroundTurret::postSpawn ()
129{
130   
131}
132
133/**
134 *
135 *
136 */
137void GroundTurret::leftWorld ()
138{
139   
140}
Note: See TracBrowser for help on using the repository browser.