Last change
on this file since 4593 was
4488,
checked in by patrick, 19 years ago
|
orxonox/trunk: started cleaning up the list classes
|
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 | |
---|
[4397] | 28 | TestEntity::TestEntity () : WorldEntity(), PhysicsInterface(this) |
---|
[4245] | 29 | { |
---|
[4320] | 30 | this->setClassID(CL_TEST_ENTITY, "TestEntity"); |
---|
[4245] | 31 | |
---|
[4462] | 32 | this->md2Model = new MD2Model("models/tris.md2", "models/tris.pcx"); |
---|
[4276] | 33 | this->md2Model->debug(); |
---|
[4245] | 34 | } |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | TestEntity::~TestEntity () |
---|
[4462] | 38 | { |
---|
| 39 | delete this->md2Model; |
---|
| 40 | } |
---|
[4245] | 41 | |
---|
| 42 | |
---|
[4488] | 43 | void TestEntity::setAnim(int animationIndex) |
---|
| 44 | { |
---|
| 45 | this->md2Model->setAnim(animationIndex); |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | |
---|
[4245] | 49 | void TestEntity::tick (float time) |
---|
| 50 | { |
---|
[4276] | 51 | this->md2Model->tick(time); |
---|
[4245] | 52 | } |
---|
| 53 | |
---|
| 54 | |
---|
| 55 | void TestEntity::hit (WorldEntity* weapon, Vector* loc) {} |
---|
| 56 | |
---|
| 57 | |
---|
| 58 | void TestEntity::destroy () {} |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | void TestEntity::collide (WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags) {} |
---|
| 62 | |
---|
| 63 | |
---|
| 64 | void TestEntity::draw () |
---|
| 65 | { |
---|
| 66 | glMatrixMode(GL_MODELVIEW); |
---|
| 67 | glPushMatrix(); |
---|
| 68 | float matrix[4][4]; |
---|
| 69 | |
---|
| 70 | glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); |
---|
| 71 | this->getAbsDir().matrix (matrix); |
---|
| 72 | glMultMatrixf((float*)matrix); |
---|
| 73 | |
---|
[4276] | 74 | this->md2Model->draw(); |
---|
[4245] | 75 | |
---|
| 76 | |
---|
| 77 | glPopMatrix(); |
---|
| 78 | } |
---|
| 79 | |
---|
Note: See
TracBrowser
for help on using the repository browser.