Last change
on this file since 4276 was
4276,
checked in by patrick, 19 years ago
|
orxonox/trunk: cleaned out the md2 model class, there is now only one model again
|
File size:
1.4 KB
|
Rev | Line | |
---|
[4245] | 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 | |
---|
| 24 | using namespace std; |
---|
| 25 | |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | TestEntity::TestEntity () : WorldEntity() |
---|
| 29 | { |
---|
[4276] | 30 | this->md2Model = new MD2Model(); |
---|
| 31 | this->md2Model->loadModel(ResourceManager::getFullName("models/tris.md2")); |
---|
| 32 | // this->md2Model->loadSkin(ResourceManager::getFullName("models/tris.pcx")); |
---|
| 33 | this->md2Model->loadSkin("../data/models/tris.pcx"); |
---|
[4245] | 34 | |
---|
| 35 | |
---|
[4276] | 36 | this->md2Model->debug(); |
---|
[4245] | 37 | } |
---|
| 38 | |
---|
| 39 | |
---|
| 40 | TestEntity::~TestEntity () |
---|
| 41 | {} |
---|
| 42 | |
---|
| 43 | |
---|
| 44 | void TestEntity::tick (float time) |
---|
| 45 | { |
---|
[4276] | 46 | this->md2Model->tick(time); |
---|
[4245] | 47 | } |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | void TestEntity::hit (WorldEntity* weapon, Vector* loc) {} |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | void TestEntity::destroy () {} |
---|
| 54 | |
---|
| 55 | |
---|
| 56 | void TestEntity::collide (WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags) {} |
---|
| 57 | |
---|
| 58 | |
---|
| 59 | void TestEntity::draw () |
---|
| 60 | { |
---|
| 61 | glMatrixMode(GL_MODELVIEW); |
---|
| 62 | glPushMatrix(); |
---|
| 63 | float matrix[4][4]; |
---|
| 64 | |
---|
| 65 | glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); |
---|
| 66 | this->getAbsDir().matrix (matrix); |
---|
| 67 | glMultMatrixf((float*)matrix); |
---|
| 68 | |
---|
[4276] | 69 | this->md2Model->draw(); |
---|
[4245] | 70 | |
---|
| 71 | |
---|
| 72 | glPopMatrix(); |
---|
| 73 | } |
---|
| 74 | |
---|
Note: See
TracBrowser
for help on using the repository browser.