Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/proto/proto_world_entity.cc @ 4190

Last change on this file since 4190 was 3762, checked in by bensch, 20 years ago

orxonox/trunk: added the tick function

File size: 1.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
16#include "proto_world_entity.h"
17#include "glincl.h"
18#include "stdincl.h"
19#include "vector.h"
20#include "model.h"
21
22using namespace std;
23
24/**
25   \brief standard constructor
26
27*/
28ProtoWorldEntity::ProtoWorldEntity () 
29{
30  this->model = (Model*)ResourceManager::getInstance()->load("cube", PRIM, RP_LEVEL);
31}
32
33/**
34   \brief standard deconstructor
35*/
36ProtoWorldEntity::~ProtoWorldEntity () 
37{
38
39}
40
41/**
42   \brief advances the ProtoWorldEntity about time seconds
43   \param time the Time to step
44*/
45ProtoWorldEntity::tick(float time)
46{
47
48}
49
50/**
51   \biref draws this worldEntity
52*/
53void ProtoWorldEntity::draw ()
54{ 
55  glMatrixMode(GL_MODELVIEW);
56  glPushMatrix();
57  float matrix[4][4];
58 
59  /* translate */
60  glTranslatef (this->getAbsCoor ().x, 
61                this->getAbsCoor ().y, 
62                this->getAbsCoor ().z);
63  /* rotate */
64  this->getAbsDir().matrix(matrix);
65  glMultMatrixf((float*)matrix);
66
67  if (model)
68    model->draw();
69  glPopMatrix();
70}
Note: See TracBrowser for help on using the repository browser.