/* 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 "state.h" #include "class_id_DEPRECATED.h" ObjectListDefinition(TestEntity); CREATE_FACTORY(TestEntity); /** * */ TestEntity::TestEntity () { this->init(); } /** * */ TestEntity::TestEntity(const TiXmlElement* root) { this->init(); if( root != NULL) this->loadParams(root); } /** * */ TestEntity::~TestEntity () {} /** * */ void TestEntity::init() { this->rtri = 0; this->registerObject(this, TestEntity::_objectList); this->toList(OM_GROUP_01); } /** * 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::tick (float time) { this->rtri += 2.0f; } /** * */ void TestEntity::draw() const { glPushMatrix(); glPushAttrib(GL_ENABLE_BIT); glMatrixMode(GL_MODELVIEW); glDisable(GL_LIGHTING); //glDisable(GL_BLEND); /* Move the object */ glTranslatef(-1200.0f, 300.0f, 700.0f); glRotatef(rtri, 0.0f, 1.0f, 0.0f); /* Rotate The Triangle On The Y axis */ /* Drawing the Triangles4 */ glBegin(GL_TRIANGLES); /* Drawing Using Triangles */ glColor3f( 20, 0.0f, 0.0f); /* Red */ glVertex3f( 0.0f, 20, 0.0f); /* Top Of Triangle (Front) */ glColor3f( 0.0f, 20, 0.0f); /* Green */ glVertex3f(-20, -20, 20); /* Left Of Triangle (Front) */ glColor3f( 0.0f, 0.0f, 20); /* Blue */ glVertex3f( 20, -20, 20); /* Right Of Triangle (Front) */ glColor3f( 20, 0.0f, 0.0f); /* Red */ glVertex3f( 0.0f, 20, 0.0f); /* Top Of Triangle (Right) */ glColor3f( 0.0f, 0.0f, 20); /* Blue */ glVertex3f( 20, -20, 20); /* Left Of Triangle (Right) */ glColor3f( 0.0f, 20, 0.0f); /* Green */ glVertex3f( 20, -20, -20); /* Right Of Triangle (Right) */ glColor3f( 20, 0.0f, 0.0f); /* Red */ glVertex3f( 0.0f, 20, 0.0f); /* Top Of Triangle (Back) */ glColor3f( 0.0f, 20, 0.0f); /* Green */ glVertex3f( 20, -20, -20); /* Left Of Triangle (Back) */ glColor3f( 0.0f, 0.0f, 20); /* Blue */ glVertex3f(-20, -20, -20); /* Right Of Triangle (Back) */ glColor3f( 20, 0.0f, 0.0f); /* Red */ glVertex3f( 0.0f, 20, 0.0f); /* Top Of Triangle (Left) */ glColor3f( 0.0f, 0.0f, 20); /* Blue */ glVertex3f(-20, -20, -20); /* Left Of Triangle (Left) */ glColor3f( 0.0f, 20, 0.0f); /* Green */ glVertex3f(-20, -20, 20); /* Right Of Triangle (Left) */ glEnd(); /* Finished Drawing The Triangles */ glPopAttrib(); glPopMatrix(); }