Last change
on this file since 3570 was
3566,
checked in by bensch, 19 years ago
|
orxonox/trunk: updated the terrain class to more functionality
view goes farther 2000 instead of 250
model gets deleted by world_entity instead of childs
|
File size:
1.3 KB
|
Rev | Line | |
---|
[3524] | 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 "primitive.h" |
---|
| 20 | #include "stdincl.h" |
---|
| 21 | #include "world_entity.h" |
---|
| 22 | #include "vector.h" |
---|
| 23 | #include "objModel.h" |
---|
| 24 | |
---|
| 25 | using namespace std; |
---|
| 26 | |
---|
| 27 | |
---|
| 28 | Primitive::Primitive (PRIMITIVE_FORM form) : WorldEntity() |
---|
| 29 | { |
---|
| 30 | this->model = new OBJModel("../data/models/fighter.obj"); |
---|
| 31 | //this->model = new OBJModel(""); |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | |
---|
| 36 | Primitive::~Primitive () |
---|
| 37 | { |
---|
[3566] | 38 | |
---|
[3524] | 39 | } |
---|
| 40 | |
---|
| 41 | void Primitive::tick (float time) |
---|
| 42 | { |
---|
| 43 | Vector v(0.0, 0.0, 1.0); |
---|
| 44 | Quaternion q(10.0, v); |
---|
[3537] | 45 | //this->relDirection = this->relDirection * q; |
---|
[3524] | 46 | } |
---|
| 47 | |
---|
| 48 | void Primitive::hit (WorldEntity* weapon, Vector loc) {} |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | void Primitive::collide (WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags) {} |
---|
| 52 | |
---|
| 53 | void Primitive::draw () |
---|
| 54 | { |
---|
| 55 | glMatrixMode(GL_MODELVIEW); |
---|
[3526] | 56 | glPushMatrix(); |
---|
[3524] | 57 | float matrix[4][4]; |
---|
| 58 | |
---|
| 59 | glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); |
---|
| 60 | //rotate |
---|
| 61 | this->getAbsDir().matrix (matrix); |
---|
| 62 | glMultMatrixf((float*)matrix); |
---|
| 63 | |
---|
| 64 | this->model->draw(); |
---|
[3526] | 65 | glPopMatrix(); |
---|
[3524] | 66 | } |
---|
| 67 | |
---|
Note: See
TracBrowser
for help on using the repository browser.