Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/world_entities/test_entity.cc @ 4336

Last change on this file since 4336 was 4320, checked in by patrick, 20 years ago

orxonox/trunk: now string name of a class works parallel to the int id representation and is only used for documentation purposes

File size: 1.5 KB
Line 
1
2
3/*
4   orxonox - the future of 3D-vertical-scrollers
5
6   Copyright (C) 2004 orx
7
8   This program is free software; you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation; either version 2, or (at your option)
11   any later version.
12
13   ### File Specific
14   main-programmer: Patrick Boenzli
15   co-programmer:
16*/
17
18
19#include "test_entity.h"
20#include "stdincl.h"
21#include "model.h"
22#include "md2Model.h"
23
24using namespace std;
25
26
27
28TestEntity::TestEntity () : WorldEntity()
29{ 
30  this->setClassID(CL_TEST_ENTITY, "TestEntity");
31  this->md2Model = new MD2Model();
32  this->md2Model->loadModel(ResourceManager::getFullName("models/tris.md2"));
33  //  this->md2Model->loadSkin(ResourceManager::getFullName("models/tris.pcx"));
34  this->md2Model->loadSkin("../data/models/tris.pcx");
35
36
37  this->md2Model->debug();
38}
39
40
41TestEntity::~TestEntity () 
42{}
43
44
45void TestEntity::tick (float time) 
46{
47  this->md2Model->tick(time);
48}
49
50
51void TestEntity::hit (WorldEntity* weapon, Vector* loc) {}
52
53
54void TestEntity::destroy () {}
55
56
57void TestEntity::collide (WorldEntity* other,  Uint32 ownhitflags, Uint32 otherhitflags) {}
58
59
60void TestEntity::draw () 
61{
62  glMatrixMode(GL_MODELVIEW);
63  glPushMatrix();
64  float matrix[4][4];
65 
66  glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z);
67  this->getAbsDir().matrix (matrix);
68  glMultMatrixf((float*)matrix);
69 
70  this->md2Model->draw();
71 
72
73  glPopMatrix();
74}
75
Note: See TracBrowser for help on using the repository browser.