source:
orxonox.OLD/trunk/src/world_entities/environment.cc
@
5357
Last change on this file since 5357 was 5357, checked in by bensch, 19 years ago | |
---|---|
File size: 1.4 KB |
Rev | Line | |
---|---|---|
[1883] | 1 | |
2 | ||
[4597] | 3 | /* |
[1883] | 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 | ||
[2036] | 13 | ### File Specific |
14 | main-programmer: Patrick Boenzli | |
[4597] | 15 | co-programmer: |
[1883] | 16 | */ |
[5357] | 17 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY |
[1883] | 18 | |
19 | ||
20 | #include "environment.h" | |
[5143] | 21 | |
22 | #include "resource_manager.h" | |
23 | ||
[2816] | 24 | #include "vector.h" |
[3484] | 25 | #include "objModel.h" |
[4682] | 26 | #include "obb_tree.h" |
[1883] | 27 | |
28 | using namespace std; | |
29 | ||
30 | ||
[4490] | 31 | /** |
[4836] | 32 | * creates an environment |
[4490] | 33 | */ |
[2816] | 34 | Environment::Environment () : WorldEntity() |
[1883] | 35 | { |
[4597] | 36 | this->setClassID(CL_ENVIRONMENT, "Environment"); |
[5308] | 37 | this->loadModel("models/ships/bolido.obj"); |
[4682] | 38 | |
[5285] | 39 | /* if(this->obbTree == NULL) |
40 | this->obbTree = new OBBTree(4, (sVec3D*)this->model->getVertexArray(), this->model->getVertexCount());*/ | |
[1883] | 41 | } |
42 | ||
43 | ||
[4490] | 44 | /** |
[4836] | 45 | * deletes an environment |
[4490] | 46 | */ |
[4597] | 47 | Environment::~Environment () |
[5047] | 48 | {} |
[3566] | 49 | |
[1883] | 50 | |
[4490] | 51 | /** |
[4836] | 52 | * ticks the environment |
53 | * @param time the time about which to tick | |
[4490] | 54 | */ |
[2816] | 55 | void Environment::tick (float time) {} |
[1883] | 56 | |
[2816] | 57 | |
[4490] | 58 | /** |
[4836] | 59 | * draws the Environment |
[4490] | 60 | */ |
[4597] | 61 | void Environment::draw () |
[2816] | 62 | { |
63 | glMatrixMode(GL_MODELVIEW); | |
[3526] | 64 | glPushMatrix(); |
[2816] | 65 | float matrix[4][4]; |
[4597] | 66 | |
[3365] | 67 | glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); |
68 | //rotate | |
[3433] | 69 | this->getAbsDir().matrix (matrix); |
[3365] | 70 | glMultMatrixf((float*)matrix); |
[4597] | 71 | |
[3365] | 72 | this->model->draw(); |
[3526] | 73 | |
74 | glPopMatrix(); | |
[2816] | 75 | } |
76 |
Note: See TracBrowser
for help on using the repository browser.