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 "environment.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 | /** |
---|
29 | \brief creates an environment |
---|
30 | */ |
---|
31 | Environment::Environment () : WorldEntity() |
---|
32 | { |
---|
33 | |
---|
34 | } |
---|
35 | |
---|
36 | |
---|
37 | /** |
---|
38 | \brief deletes an environment |
---|
39 | */ |
---|
40 | Environment::~Environment () |
---|
41 | { |
---|
42 | |
---|
43 | } |
---|
44 | |
---|
45 | /** |
---|
46 | \brief ticks the environment |
---|
47 | \param time the time about which to tick |
---|
48 | */ |
---|
49 | void Environment::tick (float time) {} |
---|
50 | |
---|
51 | /** |
---|
52 | \brief if a hit occures |
---|
53 | */ |
---|
54 | void Environment::hit (WorldEntity* weapon, Vector* loc) {} |
---|
55 | |
---|
56 | /** |
---|
57 | \brief destroys an Environment |
---|
58 | */ |
---|
59 | void Environment::destroy () {} |
---|
60 | |
---|
61 | /** |
---|
62 | \brief a collision with some ship |
---|
63 | */ |
---|
64 | void Environment::collide (WorldEntity* other, Uint32 ownhitflags, Uint32 otherhitflags) {} |
---|
65 | |
---|
66 | /** |
---|
67 | \brief draws the Environment |
---|
68 | */ |
---|
69 | void Environment::draw () |
---|
70 | { |
---|
71 | //this->getRelCoor().debug(); |
---|
72 | |
---|
73 | glMatrixMode(GL_MODELVIEW); |
---|
74 | glPushMatrix(); |
---|
75 | float matrix[4][4]; |
---|
76 | |
---|
77 | glTranslatef (this->getAbsCoor ().x, this->getAbsCoor ().y, this->getAbsCoor ().z); |
---|
78 | //rotate |
---|
79 | this->getAbsDir().matrix (matrix); |
---|
80 | glMultMatrixf((float*)matrix); |
---|
81 | |
---|
82 | this->model->draw(); |
---|
83 | |
---|
84 | glPopMatrix(); |
---|
85 | } |
---|
86 | |
---|