1 | /* |
---|
2 | ----------------------------------------------------------------------------- |
---|
3 | This source file is part of OGRE |
---|
4 | (Object-oriented Graphics Rendering Engine) |
---|
5 | For the latest info, see http://www.ogre3d.org/ |
---|
6 | |
---|
7 | Copyright (c) 2000-2006 Torus Knot Software Ltd |
---|
8 | Also see acknowledgements in Readme.html |
---|
9 | |
---|
10 | This program is free software; you can redistribute it and/or modify it under |
---|
11 | the terms of the GNU Lesser General Public License as published by the Free Software |
---|
12 | Foundation; either version 2 of the License, or (at your option) any later |
---|
13 | version. |
---|
14 | |
---|
15 | This program is distributed in the hope that it will be useful, but WITHOUT |
---|
16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
---|
17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
---|
18 | |
---|
19 | You should have received a copy of the GNU Lesser General Public License along with |
---|
20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
---|
21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to |
---|
22 | http://www.gnu.org/copyleft/lesser.txt. |
---|
23 | |
---|
24 | You may alternatively use this source under the terms of a specific version of |
---|
25 | the OGRE Unrestricted License provided you have obtained such a license from |
---|
26 | Torus Knot Software Ltd. |
---|
27 | ----------------------------------------------------------------------------- |
---|
28 | */ |
---|
29 | #include "OgreStableHeaders.h" |
---|
30 | #include "OgreParticleEmitterCommands.h" |
---|
31 | #include "OgreParticleEmitter.h" |
---|
32 | #include "OgreStringConverter.h" |
---|
33 | |
---|
34 | |
---|
35 | namespace Ogre { |
---|
36 | |
---|
37 | namespace EmitterCommands { |
---|
38 | |
---|
39 | //----------------------------------------------------------------------- |
---|
40 | String CmdAngle::doGet(const void* target) const |
---|
41 | { |
---|
42 | return StringConverter::toString( |
---|
43 | static_cast<const ParticleEmitter*>(target)->getAngle() ); |
---|
44 | } |
---|
45 | void CmdAngle::doSet(void* target, const String& val) |
---|
46 | { |
---|
47 | static_cast<ParticleEmitter*>(target)->setAngle(StringConverter::parseAngle(val)); |
---|
48 | } |
---|
49 | //----------------------------------------------------------------------- |
---|
50 | String CmdColour::doGet(const void* target) const |
---|
51 | { |
---|
52 | return StringConverter::toString( |
---|
53 | static_cast<const ParticleEmitter*>(target)->getColour() ); |
---|
54 | } |
---|
55 | void CmdColour::doSet(void* target, const String& val) |
---|
56 | { |
---|
57 | static_cast<ParticleEmitter*>(target)->setColour(StringConverter::parseColourValue(val)); |
---|
58 | } |
---|
59 | //----------------------------------------------------------------------- |
---|
60 | String CmdColourRangeStart::doGet(const void* target) const |
---|
61 | { |
---|
62 | return StringConverter::toString( |
---|
63 | static_cast<const ParticleEmitter*>(target)->getColourRangeStart() ); |
---|
64 | } |
---|
65 | void CmdColourRangeStart::doSet(void* target, const String& val) |
---|
66 | { |
---|
67 | static_cast<ParticleEmitter*>(target)->setColourRangeStart(StringConverter::parseColourValue(val)); |
---|
68 | } |
---|
69 | //----------------------------------------------------------------------- |
---|
70 | String CmdColourRangeEnd::doGet(const void* target) const |
---|
71 | { |
---|
72 | return StringConverter::toString( |
---|
73 | static_cast<const ParticleEmitter*>(target)->getColourRangeEnd() ); |
---|
74 | } |
---|
75 | void CmdColourRangeEnd::doSet(void* target, const String& val) |
---|
76 | { |
---|
77 | static_cast<ParticleEmitter*>(target)->setColourRangeEnd(StringConverter::parseColourValue(val)); |
---|
78 | } |
---|
79 | //----------------------------------------------------------------------- |
---|
80 | String CmdDirection::doGet(const void* target) const |
---|
81 | { |
---|
82 | return StringConverter::toString( |
---|
83 | static_cast<const ParticleEmitter*>(target)->getDirection() ); |
---|
84 | } |
---|
85 | void CmdDirection::doSet(void* target, const String& val) |
---|
86 | { |
---|
87 | static_cast<ParticleEmitter*>(target)->setDirection(StringConverter::parseVector3(val)); |
---|
88 | } |
---|
89 | //----------------------------------------------------------------------- |
---|
90 | String CmdEmissionRate::doGet(const void* target) const |
---|
91 | { |
---|
92 | return StringConverter::toString( |
---|
93 | static_cast<const ParticleEmitter*>(target)->getEmissionRate() ); |
---|
94 | } |
---|
95 | void CmdEmissionRate::doSet(void* target, const String& val) |
---|
96 | { |
---|
97 | static_cast<ParticleEmitter*>(target)->setEmissionRate(StringConverter::parseReal(val)); |
---|
98 | } |
---|
99 | //----------------------------------------------------------------------- |
---|
100 | String CmdMaxTTL::doGet(const void* target) const |
---|
101 | { |
---|
102 | return StringConverter::toString( |
---|
103 | static_cast<const ParticleEmitter*>(target)->getMaxTimeToLive() ); |
---|
104 | } |
---|
105 | void CmdMaxTTL::doSet(void* target, const String& val) |
---|
106 | { |
---|
107 | static_cast<ParticleEmitter*>(target)->setMaxTimeToLive(StringConverter::parseReal(val)); |
---|
108 | } |
---|
109 | //----------------------------------------------------------------------- |
---|
110 | String CmdMinTTL::doGet(const void* target) const |
---|
111 | { |
---|
112 | return StringConverter::toString( |
---|
113 | static_cast<const ParticleEmitter*>(target)->getMinTimeToLive() ); |
---|
114 | } |
---|
115 | void CmdMinTTL::doSet(void* target, const String& val) |
---|
116 | { |
---|
117 | static_cast<ParticleEmitter*>(target)->setMinTimeToLive(StringConverter::parseReal(val)); |
---|
118 | } |
---|
119 | //----------------------------------------------------------------------- |
---|
120 | String CmdMaxVelocity::doGet(const void* target) const |
---|
121 | { |
---|
122 | return StringConverter::toString( |
---|
123 | static_cast<const ParticleEmitter*>(target)->getMaxParticleVelocity() ); |
---|
124 | } |
---|
125 | void CmdMaxVelocity::doSet(void* target, const String& val) |
---|
126 | { |
---|
127 | static_cast<ParticleEmitter*>(target)->setMaxParticleVelocity(StringConverter::parseReal(val)); |
---|
128 | } |
---|
129 | //----------------------------------------------------------------------- |
---|
130 | String CmdMinVelocity::doGet(const void* target) const |
---|
131 | { |
---|
132 | return StringConverter::toString( |
---|
133 | static_cast<const ParticleEmitter*>(target)->getMinParticleVelocity() ); |
---|
134 | } |
---|
135 | void CmdMinVelocity::doSet(void* target, const String& val) |
---|
136 | { |
---|
137 | static_cast<ParticleEmitter*>(target)->setMinParticleVelocity(StringConverter::parseReal(val)); |
---|
138 | } |
---|
139 | //----------------------------------------------------------------------- |
---|
140 | String CmdPosition::doGet(const void* target) const |
---|
141 | { |
---|
142 | return StringConverter::toString( |
---|
143 | static_cast<const ParticleEmitter*>(target)->getPosition() ); |
---|
144 | } |
---|
145 | void CmdPosition::doSet(void* target, const String& val) |
---|
146 | { |
---|
147 | static_cast<ParticleEmitter*>(target)->setPosition(StringConverter::parseVector3(val)); |
---|
148 | } |
---|
149 | //----------------------------------------------------------------------- |
---|
150 | String CmdTTL::doGet(const void* target) const |
---|
151 | { |
---|
152 | return StringConverter::toString( |
---|
153 | static_cast<const ParticleEmitter*>(target)->getTimeToLive() ); |
---|
154 | } |
---|
155 | void CmdTTL::doSet(void* target, const String& val) |
---|
156 | { |
---|
157 | static_cast<ParticleEmitter*>(target)->setTimeToLive(StringConverter::parseReal(val)); |
---|
158 | } |
---|
159 | //----------------------------------------------------------------------- |
---|
160 | String CmdVelocity::doGet(const void* target) const |
---|
161 | { |
---|
162 | return StringConverter::toString( |
---|
163 | static_cast<const ParticleEmitter*>(target)->getParticleVelocity() ); |
---|
164 | } |
---|
165 | void CmdVelocity::doSet(void* target, const String& val) |
---|
166 | { |
---|
167 | static_cast<ParticleEmitter*>(target)->setParticleVelocity(StringConverter::parseReal(val)); |
---|
168 | } |
---|
169 | //----------------------------------------------------------------------- |
---|
170 | String CmdDuration::doGet(const void* target) const |
---|
171 | { |
---|
172 | return StringConverter::toString( |
---|
173 | static_cast<const ParticleEmitter*>(target)->getDuration() ); |
---|
174 | } |
---|
175 | void CmdDuration::doSet(void* target, const String& val) |
---|
176 | { |
---|
177 | static_cast<ParticleEmitter*>(target)->setDuration(StringConverter::parseReal(val)); |
---|
178 | } |
---|
179 | //----------------------------------------------------------------------- |
---|
180 | String CmdMinDuration::doGet(const void* target) const |
---|
181 | { |
---|
182 | return StringConverter::toString( |
---|
183 | static_cast<const ParticleEmitter*>(target)->getMinDuration() ); |
---|
184 | } |
---|
185 | void CmdMinDuration::doSet(void* target, const String& val) |
---|
186 | { |
---|
187 | static_cast<ParticleEmitter*>(target)->setMinDuration(StringConverter::parseReal(val)); |
---|
188 | } |
---|
189 | //----------------------------------------------------------------------- |
---|
190 | String CmdMaxDuration::doGet(const void* target) const |
---|
191 | { |
---|
192 | return StringConverter::toString( |
---|
193 | static_cast<const ParticleEmitter*>(target)->getMaxDuration() ); |
---|
194 | } |
---|
195 | void CmdMaxDuration::doSet(void* target, const String& val) |
---|
196 | { |
---|
197 | static_cast<ParticleEmitter*>(target)->setMaxDuration(StringConverter::parseReal(val)); |
---|
198 | } |
---|
199 | //----------------------------------------------------------------------- |
---|
200 | String CmdRepeatDelay::doGet(const void* target) const |
---|
201 | { |
---|
202 | return StringConverter::toString( |
---|
203 | static_cast<const ParticleEmitter*>(target)->getRepeatDelay() ); |
---|
204 | } |
---|
205 | void CmdRepeatDelay::doSet(void* target, const String& val) |
---|
206 | { |
---|
207 | static_cast<ParticleEmitter*>(target)->setRepeatDelay(StringConverter::parseReal(val)); |
---|
208 | } |
---|
209 | //----------------------------------------------------------------------- |
---|
210 | String CmdMinRepeatDelay::doGet(const void* target) const |
---|
211 | { |
---|
212 | return StringConverter::toString( |
---|
213 | static_cast<const ParticleEmitter*>(target)->getMinRepeatDelay() ); |
---|
214 | } |
---|
215 | void CmdMinRepeatDelay::doSet(void* target, const String& val) |
---|
216 | { |
---|
217 | static_cast<ParticleEmitter*>(target)->setMinRepeatDelay(StringConverter::parseReal(val)); |
---|
218 | } |
---|
219 | //----------------------------------------------------------------------- |
---|
220 | String CmdMaxRepeatDelay::doGet(const void* target) const |
---|
221 | { |
---|
222 | return StringConverter::toString( |
---|
223 | static_cast<const ParticleEmitter*>(target)->getMaxRepeatDelay() ); |
---|
224 | } |
---|
225 | void CmdMaxRepeatDelay::doSet(void* target, const String& val) |
---|
226 | { |
---|
227 | static_cast<ParticleEmitter*>(target)->setMaxRepeatDelay(StringConverter::parseReal(val)); |
---|
228 | } |
---|
229 | //----------------------------------------------------------------------- |
---|
230 | String CmdName::doGet(const void* target) const |
---|
231 | { |
---|
232 | return |
---|
233 | static_cast<const ParticleEmitter*>(target)->getName(); |
---|
234 | } |
---|
235 | void CmdName::doSet(void* target, const String& val) |
---|
236 | { |
---|
237 | static_cast<ParticleEmitter*>(target)->setName(val); |
---|
238 | } |
---|
239 | //----------------------------------------------------------------------- |
---|
240 | String CmdEmittedEmitter::doGet(const void* target) const |
---|
241 | { |
---|
242 | return |
---|
243 | static_cast<const ParticleEmitter*>(target)->getEmittedEmitter(); |
---|
244 | } |
---|
245 | void CmdEmittedEmitter::doSet(void* target, const String& val) |
---|
246 | { |
---|
247 | static_cast<ParticleEmitter*>(target)->setEmittedEmitter(val); |
---|
248 | } |
---|
249 | |
---|
250 | |
---|
251 | |
---|
252 | } |
---|
253 | } |
---|
254 | |
---|