1 | /* |
---|
2 | orxonox - the future of 3D-vertical-scrollers |
---|
3 | |
---|
4 | Copyright (C) 2004 orx |
---|
5 | |
---|
6 | This program is free software; you can redistribute it and/or modify |
---|
7 | it under the terms of the GNU General Public License as published by |
---|
8 | the Free Software Foundation; either version 2, or (at your option) |
---|
9 | any later version. |
---|
10 | |
---|
11 | ### File Specific: |
---|
12 | main-programmer: ... |
---|
13 | co-programmer: ... |
---|
14 | */ |
---|
15 | |
---|
16 | #include "proto_world_entity.h" |
---|
17 | |
---|
18 | ObjectListDefinition(ProtoWorldEntity); |
---|
19 | |
---|
20 | |
---|
21 | /** |
---|
22 | * constructs and loads a ProtoWorldEntity from a XML-element |
---|
23 | * @param root the XML-element to load from |
---|
24 | */ |
---|
25 | ProtoWorldEntity::ProtoWorldEntity(const TiXmlElement* root) |
---|
26 | { |
---|
27 | this->registerObject(this, ProtoWorldEntity::_objectList); |
---|
28 | this->init(); |
---|
29 | if (root != NULL) |
---|
30 | this->loadParams(root); |
---|
31 | } |
---|
32 | |
---|
33 | |
---|
34 | /** |
---|
35 | * standard deconstructor |
---|
36 | */ |
---|
37 | ProtoWorldEntity::~ProtoWorldEntity () |
---|
38 | { |
---|
39 | |
---|
40 | } |
---|
41 | |
---|
42 | |
---|
43 | /** |
---|
44 | * initializes the ProtoWorldEntity |
---|
45 | * @todo change this to what you wish |
---|
46 | */ |
---|
47 | void ProtoWorldEntity::init() |
---|
48 | { |
---|
49 | |
---|
50 | } |
---|
51 | |
---|
52 | |
---|
53 | /** |
---|
54 | * loads a ProtoWorldEntity from a XML-element |
---|
55 | * @param root the XML-element to load from |
---|
56 | * @todo make the class Loadable |
---|
57 | */ |
---|
58 | void ProtoWorldEntity::loadParams(const TiXmlElement* root) |
---|
59 | { |
---|
60 | // all the clases this Entity is directly derived from must be called in this way, to load all settings. |
---|
61 | WorldEntity::loadParam(root); |
---|
62 | |
---|
63 | |
---|
64 | /** |
---|
65 | * @todo: make the class Loadable |
---|
66 | */ |
---|
67 | } |
---|
68 | |
---|
69 | |
---|
70 | /** |
---|
71 | * advances the ProtoWorldEntity about time seconds |
---|
72 | * @param time the Time to step |
---|
73 | */ |
---|
74 | ProtoWorldEntity::tick(float time) |
---|
75 | { |
---|
76 | |
---|
77 | } |
---|
78 | |
---|
79 | /** |
---|
80 | * draws this worldEntity |
---|
81 | */ |
---|
82 | void ProtoWorldEntity::draw () const |
---|
83 | { |
---|
84 | glMatrixMode(GL_MODELVIEW); |
---|
85 | glPushMatrix(); |
---|
86 | float matrix[4][4]; |
---|
87 | |
---|
88 | /* translate */ |
---|
89 | glTranslatef (this->getAbsCoor ().x, |
---|
90 | this->getAbsCoor ().y, |
---|
91 | this->getAbsCoor ().z); |
---|
92 | /* rotate */ |
---|
93 | this->getAbsDir().matrix(matrix); |
---|
94 | glMultMatrixf((float*)matrix); |
---|
95 | |
---|
96 | if (model) |
---|
97 | model->draw(); |
---|
98 | glPopMatrix(); |
---|
99 | } |
---|
100 | |
---|
101 | |
---|
102 | /** |
---|
103 | * |
---|
104 | * |
---|
105 | */ |
---|
106 | void ProtoWorldEntity::collidesWith (WorldEntity* entity, const Vector& location) |
---|
107 | { |
---|
108 | |
---|
109 | } |
---|