/src/ogre/OgreMain/src/OgreParticleEmitterCommands.cpp
Line | Count | Source |
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-2014 Torus Knot Software Ltd |
8 | | |
9 | | Permission is hereby granted, free of charge, to any person obtaining a copy |
10 | | of this software and associated documentation files (the "Software"), to deal |
11 | | in the Software without restriction, including without limitation the rights |
12 | | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
13 | | copies of the Software, and to permit persons to whom the Software is |
14 | | furnished to do so, subject to the following conditions: |
15 | | |
16 | | The above copyright notice and this permission notice shall be included in |
17 | | all copies or substantial portions of the Software. |
18 | | |
19 | | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
20 | | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
21 | | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
22 | | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
23 | | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
24 | | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
25 | | THE SOFTWARE. |
26 | | ----------------------------------------------------------------------------- |
27 | | */ |
28 | | #include "OgreStableHeaders.h" |
29 | | #include "OgreParticleEmitterCommands.h" |
30 | | #include "OgreParticleEmitter.h" |
31 | | |
32 | | namespace Ogre { |
33 | | |
34 | | namespace EmitterCommands { |
35 | | |
36 | | //----------------------------------------------------------------------- |
37 | | String CmdAngle::doGet(const void* target) const |
38 | 0 | { |
39 | 0 | return StringConverter::toString( |
40 | 0 | static_cast<const ParticleEmitter*>(target)->getAngle() ); |
41 | 0 | } |
42 | | void CmdAngle::doSet(void* target, const String& val) |
43 | 0 | { |
44 | 0 | static_cast<ParticleEmitter*>(target)->setAngle(StringConverter::parseAngle(val)); |
45 | 0 | } |
46 | | //----------------------------------------------------------------------- |
47 | | String CmdColour::doGet(const void* target) const |
48 | 0 | { |
49 | 0 | return StringConverter::toString( |
50 | 0 | static_cast<const ParticleEmitter*>(target)->getColour() ); |
51 | 0 | } |
52 | | void CmdColour::doSet(void* target, const String& val) |
53 | 0 | { |
54 | 0 | static_cast<ParticleEmitter*>(target)->setColour(StringConverter::parseColourValue(val)); |
55 | 0 | } |
56 | | //----------------------------------------------------------------------- |
57 | | String CmdColourRangeStart::doGet(const void* target) const |
58 | 0 | { |
59 | 0 | return StringConverter::toString( |
60 | 0 | static_cast<const ParticleEmitter*>(target)->getColourRangeStart() ); |
61 | 0 | } |
62 | | void CmdColourRangeStart::doSet(void* target, const String& val) |
63 | 0 | { |
64 | 0 | static_cast<ParticleEmitter*>(target)->setColourRangeStart(StringConverter::parseColourValue(val)); |
65 | 0 | } |
66 | | //----------------------------------------------------------------------- |
67 | | String CmdColourRangeEnd::doGet(const void* target) const |
68 | 0 | { |
69 | 0 | return StringConverter::toString( |
70 | 0 | static_cast<const ParticleEmitter*>(target)->getColourRangeEnd() ); |
71 | 0 | } |
72 | | void CmdColourRangeEnd::doSet(void* target, const String& val) |
73 | 0 | { |
74 | 0 | static_cast<ParticleEmitter*>(target)->setColourRangeEnd(StringConverter::parseColourValue(val)); |
75 | 0 | } |
76 | | //----------------------------------------------------------------------- |
77 | | String CmdDirection::doGet(const void* target) const |
78 | 0 | { |
79 | 0 | return StringConverter::toString( |
80 | 0 | static_cast<const ParticleEmitter*>(target)->getDirection() ); |
81 | 0 | } |
82 | | void CmdDirection::doSet(void* target, const String& val) |
83 | 0 | { |
84 | 0 | static_cast<ParticleEmitter*>(target)->setDirection(StringConverter::parseVector3(val)); |
85 | 0 | } |
86 | | //----------------------------------------------------------------------- |
87 | | String CmdUp::doGet(const void* target) const |
88 | 0 | { |
89 | 0 | return StringConverter::toString( |
90 | 0 | static_cast<const ParticleEmitter*>(target)->getUp() ); |
91 | 0 | } |
92 | | void CmdUp::doSet(void* target, const String& val) |
93 | 0 | { |
94 | 0 | static_cast<ParticleEmitter*>(target)->setUp(StringConverter::parseVector3(val)); |
95 | 0 | } |
96 | | //----------------------------------------------------------------------- |
97 | | String CmdDirPositionRef::doGet(const void* target) const |
98 | 0 | { |
99 | 0 | Vector4 val( static_cast<const ParticleEmitter*>(target)->getDirPositionReference() ); |
100 | 0 | val.w = static_cast<const ParticleEmitter*>(target)->getDirPositionReferenceEnabled(); |
101 | 0 | return StringConverter::toString( val ); |
102 | 0 | } |
103 | | void CmdDirPositionRef::doSet(void* target, const String& val) |
104 | 0 | { |
105 | 0 | const Vector4 parsed = StringConverter::parseVector4(val); |
106 | 0 | const Vector3 vPos( parsed.x, parsed.y, parsed.z ); |
107 | 0 | static_cast<ParticleEmitter*>(target)->setDirPositionReference( vPos, parsed.w != 0 ); |
108 | 0 | } |
109 | | //----------------------------------------------------------------------- |
110 | | String CmdEmissionRate::doGet(const void* target) const |
111 | 0 | { |
112 | 0 | return StringConverter::toString( |
113 | 0 | static_cast<const ParticleEmitter*>(target)->getEmissionRate() ); |
114 | 0 | } |
115 | | void CmdEmissionRate::doSet(void* target, const String& val) |
116 | 0 | { |
117 | 0 | static_cast<ParticleEmitter*>(target)->setEmissionRate(StringConverter::parseReal(val)); |
118 | 0 | } |
119 | | //----------------------------------------------------------------------- |
120 | | String CmdMaxTTL::doGet(const void* target) const |
121 | 0 | { |
122 | 0 | return StringConverter::toString( |
123 | 0 | static_cast<const ParticleEmitter*>(target)->getMaxTimeToLive() ); |
124 | 0 | } |
125 | | void CmdMaxTTL::doSet(void* target, const String& val) |
126 | 0 | { |
127 | 0 | static_cast<ParticleEmitter*>(target)->setMaxTimeToLive(StringConverter::parseReal(val)); |
128 | 0 | } |
129 | | //----------------------------------------------------------------------- |
130 | | String CmdMinTTL::doGet(const void* target) const |
131 | 0 | { |
132 | 0 | return StringConverter::toString( |
133 | 0 | static_cast<const ParticleEmitter*>(target)->getMinTimeToLive() ); |
134 | 0 | } |
135 | | void CmdMinTTL::doSet(void* target, const String& val) |
136 | 0 | { |
137 | 0 | static_cast<ParticleEmitter*>(target)->setMinTimeToLive(StringConverter::parseReal(val)); |
138 | 0 | } |
139 | | //----------------------------------------------------------------------- |
140 | | String CmdMaxVelocity::doGet(const void* target) const |
141 | 0 | { |
142 | 0 | return StringConverter::toString( |
143 | 0 | static_cast<const ParticleEmitter*>(target)->getMaxParticleVelocity() ); |
144 | 0 | } |
145 | | void CmdMaxVelocity::doSet(void* target, const String& val) |
146 | 0 | { |
147 | 0 | static_cast<ParticleEmitter*>(target)->setMaxParticleVelocity(StringConverter::parseReal(val)); |
148 | 0 | } |
149 | | //----------------------------------------------------------------------- |
150 | | String CmdMinVelocity::doGet(const void* target) const |
151 | 0 | { |
152 | 0 | return StringConverter::toString( |
153 | 0 | static_cast<const ParticleEmitter*>(target)->getMinParticleVelocity() ); |
154 | 0 | } |
155 | | void CmdMinVelocity::doSet(void* target, const String& val) |
156 | 0 | { |
157 | 0 | static_cast<ParticleEmitter*>(target)->setMinParticleVelocity(StringConverter::parseReal(val)); |
158 | 0 | } |
159 | | //----------------------------------------------------------------------- |
160 | | String CmdPosition::doGet(const void* target) const |
161 | 0 | { |
162 | 0 | return StringConverter::toString( |
163 | 0 | static_cast<const ParticleEmitter*>(target)->getPosition() ); |
164 | 0 | } |
165 | | void CmdPosition::doSet(void* target, const String& val) |
166 | 0 | { |
167 | 0 | static_cast<ParticleEmitter*>(target)->setPosition(StringConverter::parseVector3(val)); |
168 | 0 | } |
169 | | //----------------------------------------------------------------------- |
170 | | String CmdTTL::doGet(const void* target) const |
171 | 0 | { |
172 | 0 | return StringConverter::toString( |
173 | 0 | static_cast<const ParticleEmitter*>(target)->getTimeToLive() ); |
174 | 0 | } |
175 | | void CmdTTL::doSet(void* target, const String& val) |
176 | 0 | { |
177 | 0 | static_cast<ParticleEmitter*>(target)->setTimeToLive(StringConverter::parseReal(val)); |
178 | 0 | } |
179 | | //----------------------------------------------------------------------- |
180 | | String CmdVelocity::doGet(const void* target) const |
181 | 0 | { |
182 | 0 | return StringConverter::toString( |
183 | 0 | static_cast<const ParticleEmitter*>(target)->getParticleVelocity() ); |
184 | 0 | } |
185 | | void CmdVelocity::doSet(void* target, const String& val) |
186 | 0 | { |
187 | 0 | static_cast<ParticleEmitter*>(target)->setParticleVelocity(StringConverter::parseReal(val)); |
188 | 0 | } |
189 | | //----------------------------------------------------------------------- |
190 | | String CmdDuration::doGet(const void* target) const |
191 | 0 | { |
192 | 0 | return StringConverter::toString( |
193 | 0 | static_cast<const ParticleEmitter*>(target)->getDuration() ); |
194 | 0 | } |
195 | | void CmdDuration::doSet(void* target, const String& val) |
196 | 0 | { |
197 | 0 | static_cast<ParticleEmitter*>(target)->setDuration(StringConverter::parseReal(val)); |
198 | 0 | } |
199 | | //----------------------------------------------------------------------- |
200 | | String CmdMinDuration::doGet(const void* target) const |
201 | 0 | { |
202 | 0 | return StringConverter::toString( |
203 | 0 | static_cast<const ParticleEmitter*>(target)->getMinDuration() ); |
204 | 0 | } |
205 | | void CmdMinDuration::doSet(void* target, const String& val) |
206 | 0 | { |
207 | 0 | static_cast<ParticleEmitter*>(target)->setMinDuration(StringConverter::parseReal(val)); |
208 | 0 | } |
209 | | //----------------------------------------------------------------------- |
210 | | String CmdMaxDuration::doGet(const void* target) const |
211 | 0 | { |
212 | 0 | return StringConverter::toString( |
213 | 0 | static_cast<const ParticleEmitter*>(target)->getMaxDuration() ); |
214 | 0 | } |
215 | | void CmdMaxDuration::doSet(void* target, const String& val) |
216 | 0 | { |
217 | 0 | static_cast<ParticleEmitter*>(target)->setMaxDuration(StringConverter::parseReal(val)); |
218 | 0 | } |
219 | | //----------------------------------------------------------------------- |
220 | | String CmdRepeatDelay::doGet(const void* target) const |
221 | 0 | { |
222 | 0 | return StringConverter::toString( |
223 | 0 | static_cast<const ParticleEmitter*>(target)->getRepeatDelay() ); |
224 | 0 | } |
225 | | void CmdRepeatDelay::doSet(void* target, const String& val) |
226 | 0 | { |
227 | 0 | static_cast<ParticleEmitter*>(target)->setRepeatDelay(StringConverter::parseReal(val)); |
228 | 0 | } |
229 | | //----------------------------------------------------------------------- |
230 | | String CmdMinRepeatDelay::doGet(const void* target) const |
231 | 0 | { |
232 | 0 | return StringConverter::toString( |
233 | 0 | static_cast<const ParticleEmitter*>(target)->getMinRepeatDelay() ); |
234 | 0 | } |
235 | | void CmdMinRepeatDelay::doSet(void* target, const String& val) |
236 | 0 | { |
237 | 0 | static_cast<ParticleEmitter*>(target)->setMinRepeatDelay(StringConverter::parseReal(val)); |
238 | 0 | } |
239 | | //----------------------------------------------------------------------- |
240 | | String CmdMaxRepeatDelay::doGet(const void* target) const |
241 | 0 | { |
242 | 0 | return StringConverter::toString( |
243 | 0 | static_cast<const ParticleEmitter*>(target)->getMaxRepeatDelay() ); |
244 | 0 | } |
245 | | void CmdMaxRepeatDelay::doSet(void* target, const String& val) |
246 | 0 | { |
247 | 0 | static_cast<ParticleEmitter*>(target)->setMaxRepeatDelay(StringConverter::parseReal(val)); |
248 | 0 | } |
249 | | //----------------------------------------------------------------------- |
250 | | String CmdName::doGet(const void* target) const |
251 | 0 | { |
252 | 0 | return |
253 | 0 | static_cast<const ParticleEmitter*>(target)->getName(); |
254 | 0 | } |
255 | | void CmdName::doSet(void* target, const String& val) |
256 | 0 | { |
257 | 0 | static_cast<ParticleEmitter*>(target)->setName(val); |
258 | 0 | } |
259 | | //----------------------------------------------------------------------- |
260 | | String CmdEmittedEmitter::doGet(const void* target) const |
261 | 0 | { |
262 | 0 | return |
263 | 0 | static_cast<const ParticleEmitter*>(target)->getEmittedEmitter(); |
264 | 0 | } |
265 | | void CmdEmittedEmitter::doSet(void* target, const String& val) |
266 | 0 | { |
267 | 0 | static_cast<ParticleEmitter*>(target)->setEmittedEmitter(val); |
268 | 0 | } |
269 | | |
270 | | |
271 | | |
272 | | } |
273 | | } |
274 | | |