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: Patrick Boenzli patrick@orxonox.net |
---|
13 | co-programmer: |
---|
14 | */ |
---|
15 | #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY |
---|
16 | |
---|
17 | |
---|
18 | #include "executor/executor.h" |
---|
19 | #include "util/loading/factory.h" |
---|
20 | #include "util/loading/load_param.h" |
---|
21 | |
---|
22 | |
---|
23 | #include "mount_point.h" |
---|
24 | #include "debug.h" |
---|
25 | #include "state.h" |
---|
26 | |
---|
27 | |
---|
28 | ObjectListDefinition(MountPoint); |
---|
29 | CREATE_FACTORY(MountPoint); |
---|
30 | |
---|
31 | |
---|
32 | /** |
---|
33 | * construct |
---|
34 | */ |
---|
35 | MountPoint::MountPoint (const Vector& up, const Vector& forward, const Vector& center, const std::string& name) |
---|
36 | { |
---|
37 | |
---|
38 | this->_name = name; |
---|
39 | this->setAbsCoor( center); |
---|
40 | this->setAbsDir( Quaternion(forward, up)); |
---|
41 | |
---|
42 | this->init(); |
---|
43 | } |
---|
44 | |
---|
45 | |
---|
46 | /** |
---|
47 | * constructor |
---|
48 | * @param root the xml root element |
---|
49 | */ |
---|
50 | MountPoint::MountPoint(const TiXmlElement* root) |
---|
51 | { |
---|
52 | this->init(); |
---|
53 | |
---|
54 | if( root != NULL) |
---|
55 | this->loadParams(root); |
---|
56 | } |
---|
57 | |
---|
58 | |
---|
59 | /** |
---|
60 | * deconstructor |
---|
61 | */ |
---|
62 | MountPoint::~MountPoint () |
---|
63 | {} |
---|
64 | |
---|
65 | |
---|
66 | /** |
---|
67 | * initializing function |
---|
68 | */ |
---|
69 | void MountPoint::init() |
---|
70 | { |
---|
71 | this->registerObject(this, MountPoint::_objectList); |
---|
72 | this->toList(OM_GROUP_00); |
---|
73 | |
---|
74 | this->_mount = NULL; |
---|
75 | } |
---|
76 | |
---|
77 | |
---|
78 | /** |
---|
79 | * loads the Settings of a MD2Creature from an XML-element. |
---|
80 | * @param root the XML-element to load the MD2Creature's properties from |
---|
81 | */ |
---|
82 | void MountPoint::loadParams(const TiXmlElement* root) |
---|
83 | { |
---|
84 | WorldEntity::loadParams(root); |
---|
85 | } |
---|
86 | |
---|
87 | |
---|
88 | |
---|
89 | /** |
---|
90 | * tick |
---|
91 | * @param time time passed since the last tick |
---|
92 | */ |
---|
93 | void MountPoint::tick (float time) |
---|
94 | { |
---|
95 | |
---|
96 | |
---|
97 | } |
---|
98 | |
---|
99 | |
---|
100 | /** |
---|
101 | * draw this entity |
---|
102 | */ |
---|
103 | void MountPoint::draw() const |
---|
104 | { |
---|
105 | |
---|
106 | } |
---|
107 | |
---|
108 | |
---|
109 | |
---|
110 | /** |
---|
111 | * function called to draw the mount point itself for debug purposes only |
---|
112 | */ |
---|
113 | void MountPoint::debugDraw() const |
---|
114 | { |
---|
115 | |
---|
116 | } |
---|
117 | |
---|
118 | |
---|
119 | /** |
---|
120 | * adds an entity to this mount point |
---|
121 | * @param entity entity to be added |
---|
122 | */ |
---|
123 | void MountPoint::mount(WorldEntity* entity) |
---|
124 | { |
---|
125 | this->_mount = entity; |
---|
126 | } |
---|
127 | |
---|
128 | |
---|
129 | /** |
---|
130 | * removes an entity from this mount point |
---|
131 | */ |
---|
132 | void MountPoint::unmount() |
---|
133 | { |
---|
134 | this->_mount = NULL; |
---|
135 | } |
---|
136 | |
---|