/* 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: co-programmer: */ #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY #include "executor/executor.h" #include "util/loading/factory.h" #include "util/loading/load_param.h" #include "test_entity.h" #include "debug.h" #include "material.h" #include "state.h" #include "class_id_DEPRECATED.h" ObjectListDefinition(TestEntity); CREATE_FACTORY(TestEntity); float i=0; bool state=1; /** * */ TestEntity::TestEntity () { this->init(); } /** * */ TestEntity::TestEntity(const TiXmlElement* root) { this->init(); if( root != NULL) this->loadParams(root); } /** * */ TestEntity::~TestEntity () {} /** * */ void TestEntity::init() { this->registerObject(this, TestEntity::_objectList); this->toList(OM_GROUP_00); /*this->material = new Material(); this->material->setIllum(3); this->material->setDiffuse(1.0,1.0,1.0); this->material->setSpecular(0.0,0.0,0.0); this->material->setAmbient(1.0, 1.0, 1.0); this->material->setDiffuseMap("maps/TE2.tga");*/ } /** * loads the Settings of a MD2Creature from an XML-element. * @param root the XML-element to load the MD2Creature's properties from */ void TestEntity::loadParams(const TiXmlElement* root) { WorldEntity::loadParams(root); } void TestEntity::draw() const { // if(!mediaLoaded) // false; // glPushAttrib(GL_ENABLE_BIT); // glDisable(GL_LIGHTING); // glDisable(GL_BLEND); // // glEnable(GL_TEXTURE_2D); // glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter)); // glPushMatrix(); /* glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); glRotatef(axis, 0.0f, 1.0f, 0.0f);*/ //PRINTF(0)("axis: %f\n", axis); //glEnable(GL_BLEND); // Turn Blending On //glColor4f(0, 0, 0, i); // glBegin(GL_QUADS); // glVertex3f(-1.0f, -100.0f, -100.0f); // glTexCoord2f(1.0f, 1.0f); // glVertex3f(-1.0f, -100.0f, 100.0f); // glTexCoord2f(0.0f, 1.0f); // glVertex3f(-1.0f, 100.0f, 100.0f); // glTexCoord2f(0.0f, 0.0f); // glVertex3f(-1.0f, 100.0f, -100.0f); // glTexCoord2f(1.0f, 0.0f); // glEnd(); // glPopMatrix(); // glPopAttrib(); } /** * */ void TestEntity::tick (float time) { // if (state==0 && i==1) // i=0; // if (state==1 && i<=1) // i=i+0.005; } void TestEntity::changeState (bool sta) { state=sta; }