/* orxonox - the future of 3D-vertical-scrollers Copyright (C) 2004 orx This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. ### File Specific: main-programmer: Manuel Leuenberger co-programmer: ... */ #include "ground_turret.h" #include "factory.h" #include "model.h" #include "turret.h" CREATE_FACTORY(GroundTurret, CL_GROUND_TURRET); using namespace std; /** * constructs and loads a GroundTurret from a XML-element * @param root the XML-element to load from */ GroundTurret::GroundTurret(const TiXmlElement* root) { this->init(); if (root != NULL) this->loadParams(root); } /** * standard deconstructor */ GroundTurret::~GroundTurret () { } /** * initializes the GroundTurret * @todo change this to what you wish */ void GroundTurret::init() { this->setClassID(CL_GROUND_TURRET, "GroundTurret"); this->loadModel("models/ground_turret.obj", 5); left = new Turret(); left->setParent(this); left->setRelCoor(0,10,0); right = new Turret(); right->setParent(this); right->setRelCoor(0,10,0); } /** * loads a GroundTurret from a XML-element * @param root the XML-element to load from * @todo make the class Loadable */ void GroundTurret::loadParams(const TiXmlElement* root) { // all the clases this Entity is directly derived from must be called in this way, to load all settings. static_cast(this)->loadParams(root); /** * @todo: make the class Loadable */ } /** * advances the GroundTurret about time seconds * @param time the Time to step */ void GroundTurret::tick(float time) { } /** * draws this worldEntity */ void GroundTurret::draw () const { glMatrixMode(GL_MODELVIEW); glPushMatrix(); float matrix[4][4]; /* translate */ glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); /* rotate */ this->getAbsDir().matrix(matrix); glMultMatrixf((float*)matrix); if (model) model->draw(); //left->draw(); //right->draw(); glPopMatrix(); } /** * * */ void GroundTurret::collidesWith (WorldEntity* entity, const Vector& location) { } /** * * */ void GroundTurret::postSpawn () { } /** * * */ void GroundTurret::leftWorld () { }