Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/camera/src/world_entities/test_entity.cc @ 10018

Last change on this file since 10018 was 10018, checked in by gfilip, 17 years ago

first up

File size: 2.3 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:
13   co-programmer:
14*/
15#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
16
17
18#include "executor/executor.h"
19#include "util/loading/factory.h"
20#include "util/loading/load_param.h"
21
22
23#include "test_entity.h"
24#include "debug.h"
25
26
27
28
29#include "state.h"
30
31
32
33#include "class_id_DEPRECATED.h"
34ObjectListDefinition(TestEntity);
35CREATE_FACTORY(TestEntity);
36
37float i=0;
38bool state=1;
39
40/**
41 *
42 */
43TestEntity::TestEntity ()
44{
45  this->init();
46}
47
48
49/**
50 *
51 */
52TestEntity::TestEntity(const TiXmlElement* root)
53{
54  this->init();
55
56  if( root != NULL)
57    this->loadParams(root);
58}
59
60
61/**
62 *
63 */
64TestEntity::~TestEntity ()
65{}
66
67
68/**
69 *
70 */
71void TestEntity::init()
72{
73  this->registerObject(this, TestEntity::_objectList);
74  this->toList(OM_GROUP_00);
75}
76
77
78/**
79 * loads the Settings of a MD2Creature from an XML-element.
80 * @param root the XML-element to load the MD2Creature's properties from
81 */
82void TestEntity::loadParams(const TiXmlElement* root)
83{
84  WorldEntity::loadParams(root);
85}
86
87void TestEntity::draw() const
88{
89//   if(!mediaLoaded)
90//     false;
91
92  glPushAttrib(GL_ENABLE_BIT);
93  glDisable(GL_LIGHTING);
94//   glDisable(GL_BLEND);
95//
96//   glEnable(GL_TEXTURE_2D);
97//   glBindTexture(GL_TEXTURE_2D, media_container->getFrameTexture(counter));
98
99  glPushMatrix();
100 /* glTranslatef (this->getAbsCoor ().x,
101                this->getAbsCoor ().y,
102                this->getAbsCoor ().z);
103  glRotatef(axis, 0.0f, 1.0f, 0.0f);*/
104//PRINTF(0)("axis: %f\n", axis);
105glEnable(GL_BLEND);     // Turn Blending On
106 
107
108
109glColor4f(0, 0, 0, i);
110
111  glBegin(GL_QUADS);
112    glVertex3f(-1.0f, -100.0f, -100.0f);
113//     glTexCoord2f(1.0f, 1.0f);
114    glVertex3f(-1.0f, -100.0f, 100.0f);
115//     glTexCoord2f(0.0f, 1.0f);
116    glVertex3f(-1.0f, 100.0f, 100.0f);
117//     glTexCoord2f(0.0f, 0.0f);
118    glVertex3f(-1.0f, 100.0f, -100.0f);
119//     glTexCoord2f(1.0f, 0.0f);
120
121  glEnd();
122
123 // glPopMatrix();
124 // glPopAttrib();
125}
126
127/**
128 *
129 */
130void TestEntity::tick (float time)
131{
132if (state==0)
133i=0;
134else
135i=i+0.005;
136
137
138
139
140}
141
142
143//void TestEntity::changeState (bool sta)
144//{
145//state=sta;
146//}
Note: See TracBrowser for help on using the repository browser.