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 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY |
---|
18 | |
---|
19 | |
---|
20 | #include "executor/executor.h" |
---|
21 | #include "util/loading/factory.h" |
---|
22 | #include "util/loading/load_param.h" |
---|
23 | |
---|
24 | #include "kill.h" |
---|
25 | #include "game_rules.h" |
---|
26 | |
---|
27 | #include "test_entity.h" |
---|
28 | |
---|
29 | |
---|
30 | #include "interactive_model.h" |
---|
31 | #include "md2/md2Model.h" |
---|
32 | |
---|
33 | #include "state.h" |
---|
34 | |
---|
35 | using namespace std; |
---|
36 | |
---|
37 | |
---|
38 | CREATE_FACTORY(Door, CL_DOOR); |
---|
39 | |
---|
40 | |
---|
41 | Door::Door () |
---|
42 | { |
---|
43 | this->init(); |
---|
44 | this->md2Model = new MD2Model("models/droidika.md2", "models/droideka.pcx"); |
---|
45 | } |
---|
46 | |
---|
47 | |
---|
48 | Door::Door(const TiXmlElement* root) |
---|
49 | { |
---|
50 | this->init(); |
---|
51 | if (root != NULL) |
---|
52 | this->loadParams(root); |
---|
53 | } |
---|
54 | |
---|
55 | |
---|
56 | Door::~Door () |
---|
57 | {} |
---|
58 | |
---|
59 | |
---|
60 | |
---|
61 | void Door::init() |
---|
62 | { |
---|
63 | this->setClassID(CL_DOOR, "Door"); |
---|
64 | this->toList(OM_COMMON); |
---|
65 | |
---|
66 | this->lastCollided = NULL; |
---|
67 | this->bDeath = false; |
---|
68 | } |
---|
69 | |
---|
70 | /** |
---|
71 | * loads the Settings of a MD2Creature from an XML-element. |
---|
72 | * @param root the XML-element to load the MD2Creature's properties from |
---|
73 | */ |
---|
74 | void Door::loadParams(const TiXmlElement* root) |
---|
75 | { |
---|
76 | WorldEntity::loadParams(root); |
---|
77 | |
---|
78 | // LoadParam(root, "", this, Door, set) |
---|
79 | // .describe("sets the animation of the md2 model") |
---|
80 | // .defaultValues(1); |
---|
81 | |
---|
82 | } |
---|
83 | |
---|
84 | |
---|
85 | void Door::setAnim(int animationIndex, int animPlaybackMode) |
---|
86 | { |
---|
87 | if( likely(this->getModel(0) != NULL)) |
---|
88 | ((InteractiveModel*)this->getModel(0))->setAnimation(animationIndex, animPlaybackMode); |
---|
89 | } |
---|
90 | |
---|
91 | |
---|
92 | void Door::tick (float time) |
---|
93 | { |
---|
94 | if( likely(this->getModel(0) != NULL)) |
---|
95 | ((InteractiveModel*)this->getModel(0))->tick(time); |
---|
96 | |
---|
97 | |
---|
98 | } |
---|
99 | |
---|
100 | |
---|
101 | |
---|
102 | /** |
---|
103 | * checks if the door is open |
---|
104 | */ |
---|
105 | void Door::checkOpen() |
---|
106 | { |
---|
107 | |
---|
108 | |
---|
109 | } |
---|
110 | |
---|
111 | |
---|
112 | |
---|