[657] | 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-2005 The OGRE Team
|
---|
| 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 | */
|
---|
| 25 | #include "OgreStableHeaders.h"
|
---|
| 26 | #include "OgreParticleEmitterCommands.h"
|
---|
| 27 | #include "OgreParticleEmitter.h"
|
---|
| 28 | #include "OgreStringConverter.h"
|
---|
| 29 |
|
---|
| 30 |
|
---|
| 31 | namespace Ogre {
|
---|
| 32 |
|
---|
| 33 | namespace EmitterCommands {
|
---|
| 34 |
|
---|
| 35 | //-----------------------------------------------------------------------
|
---|
| 36 | String CmdAngle::doGet(const void* target) const
|
---|
| 37 | {
|
---|
| 38 | return StringConverter::toString(
|
---|
| 39 | static_cast<const ParticleEmitter*>(target)->getAngle() );
|
---|
| 40 | }
|
---|
| 41 | void CmdAngle::doSet(void* target, const String& val)
|
---|
| 42 | {
|
---|
| 43 | static_cast<ParticleEmitter*>(target)->setAngle(StringConverter::parseAngle(val));
|
---|
| 44 | }
|
---|
| 45 | //-----------------------------------------------------------------------
|
---|
| 46 | String CmdColour::doGet(const void* target) const
|
---|
| 47 | {
|
---|
| 48 | return StringConverter::toString(
|
---|
| 49 | static_cast<const ParticleEmitter*>(target)->getColour() );
|
---|
| 50 | }
|
---|
| 51 | void CmdColour::doSet(void* target, const String& val)
|
---|
| 52 | {
|
---|
| 53 | static_cast<ParticleEmitter*>(target)->setColour(StringConverter::parseColourValue(val));
|
---|
| 54 | }
|
---|
| 55 | //-----------------------------------------------------------------------
|
---|
| 56 | String CmdColourRangeStart::doGet(const void* target) const
|
---|
| 57 | {
|
---|
| 58 | return StringConverter::toString(
|
---|
| 59 | static_cast<const ParticleEmitter*>(target)->getColourRangeStart() );
|
---|
| 60 | }
|
---|
| 61 | void CmdColourRangeStart::doSet(void* target, const String& val)
|
---|
| 62 | {
|
---|
| 63 | static_cast<ParticleEmitter*>(target)->setColourRangeStart(StringConverter::parseColourValue(val));
|
---|
| 64 | }
|
---|
| 65 | //-----------------------------------------------------------------------
|
---|
| 66 | String CmdColourRangeEnd::doGet(const void* target) const
|
---|
| 67 | {
|
---|
| 68 | return StringConverter::toString(
|
---|
| 69 | static_cast<const ParticleEmitter*>(target)->getColourRangeEnd() );
|
---|
| 70 | }
|
---|
| 71 | void CmdColourRangeEnd::doSet(void* target, const String& val)
|
---|
| 72 | {
|
---|
| 73 | static_cast<ParticleEmitter*>(target)->setColourRangeEnd(StringConverter::parseColourValue(val));
|
---|
| 74 | }
|
---|
| 75 | //-----------------------------------------------------------------------
|
---|
| 76 | String CmdDirection::doGet(const void* target) const
|
---|
| 77 | {
|
---|
| 78 | return StringConverter::toString(
|
---|
| 79 | static_cast<const ParticleEmitter*>(target)->getDirection() );
|
---|
| 80 | }
|
---|
| 81 | void CmdDirection::doSet(void* target, const String& val)
|
---|
| 82 | {
|
---|
| 83 | static_cast<ParticleEmitter*>(target)->setDirection(StringConverter::parseVector3(val));
|
---|
| 84 | }
|
---|
| 85 | //-----------------------------------------------------------------------
|
---|
| 86 | String CmdEmissionRate::doGet(const void* target) const
|
---|
| 87 | {
|
---|
| 88 | return StringConverter::toString(
|
---|
| 89 | static_cast<const ParticleEmitter*>(target)->getEmissionRate() );
|
---|
| 90 | }
|
---|
| 91 | void CmdEmissionRate::doSet(void* target, const String& val)
|
---|
| 92 | {
|
---|
| 93 | static_cast<ParticleEmitter*>(target)->setEmissionRate(StringConverter::parseReal(val));
|
---|
| 94 | }
|
---|
| 95 | //-----------------------------------------------------------------------
|
---|
| 96 | String CmdMaxTTL::doGet(const void* target) const
|
---|
| 97 | {
|
---|
| 98 | return StringConverter::toString(
|
---|
| 99 | static_cast<const ParticleEmitter*>(target)->getMaxTimeToLive() );
|
---|
| 100 | }
|
---|
| 101 | void CmdMaxTTL::doSet(void* target, const String& val)
|
---|
| 102 | {
|
---|
| 103 | static_cast<ParticleEmitter*>(target)->setMaxTimeToLive(StringConverter::parseReal(val));
|
---|
| 104 | }
|
---|
| 105 | //-----------------------------------------------------------------------
|
---|
| 106 | String CmdMinTTL::doGet(const void* target) const
|
---|
| 107 | {
|
---|
| 108 | return StringConverter::toString(
|
---|
| 109 | static_cast<const ParticleEmitter*>(target)->getMinTimeToLive() );
|
---|
| 110 | }
|
---|
| 111 | void CmdMinTTL::doSet(void* target, const String& val)
|
---|
| 112 | {
|
---|
| 113 | static_cast<ParticleEmitter*>(target)->setMinTimeToLive(StringConverter::parseReal(val));
|
---|
| 114 | }
|
---|
| 115 | //-----------------------------------------------------------------------
|
---|
| 116 | String CmdMaxVelocity::doGet(const void* target) const
|
---|
| 117 | {
|
---|
| 118 | return StringConverter::toString(
|
---|
| 119 | static_cast<const ParticleEmitter*>(target)->getMaxParticleVelocity() );
|
---|
| 120 | }
|
---|
| 121 | void CmdMaxVelocity::doSet(void* target, const String& val)
|
---|
| 122 | {
|
---|
| 123 | static_cast<ParticleEmitter*>(target)->setMaxParticleVelocity(StringConverter::parseReal(val));
|
---|
| 124 | }
|
---|
| 125 | //-----------------------------------------------------------------------
|
---|
| 126 | String CmdMinVelocity::doGet(const void* target) const
|
---|
| 127 | {
|
---|
| 128 | return StringConverter::toString(
|
---|
| 129 | static_cast<const ParticleEmitter*>(target)->getMinParticleVelocity() );
|
---|
| 130 | }
|
---|
| 131 | void CmdMinVelocity::doSet(void* target, const String& val)
|
---|
| 132 | {
|
---|
| 133 | static_cast<ParticleEmitter*>(target)->setMinParticleVelocity(StringConverter::parseReal(val));
|
---|
| 134 | }
|
---|
| 135 | //-----------------------------------------------------------------------
|
---|
| 136 | String CmdPosition::doGet(const void* target) const
|
---|
| 137 | {
|
---|
| 138 | return StringConverter::toString(
|
---|
| 139 | static_cast<const ParticleEmitter*>(target)->getPosition() );
|
---|
| 140 | }
|
---|
| 141 | void CmdPosition::doSet(void* target, const String& val)
|
---|
| 142 | {
|
---|
| 143 | static_cast<ParticleEmitter*>(target)->setPosition(StringConverter::parseVector3(val));
|
---|
| 144 | }
|
---|
| 145 | //-----------------------------------------------------------------------
|
---|
| 146 | String CmdTTL::doGet(const void* target) const
|
---|
| 147 | {
|
---|
| 148 | return StringConverter::toString(
|
---|
| 149 | static_cast<const ParticleEmitter*>(target)->getTimeToLive() );
|
---|
| 150 | }
|
---|
| 151 | void CmdTTL::doSet(void* target, const String& val)
|
---|
| 152 | {
|
---|
| 153 | static_cast<ParticleEmitter*>(target)->setTimeToLive(StringConverter::parseReal(val));
|
---|
| 154 | }
|
---|
| 155 | //-----------------------------------------------------------------------
|
---|
| 156 | String CmdVelocity::doGet(const void* target) const
|
---|
| 157 | {
|
---|
| 158 | return StringConverter::toString(
|
---|
| 159 | static_cast<const ParticleEmitter*>(target)->getParticleVelocity() );
|
---|
| 160 | }
|
---|
| 161 | void CmdVelocity::doSet(void* target, const String& val)
|
---|
| 162 | {
|
---|
| 163 | static_cast<ParticleEmitter*>(target)->setParticleVelocity(StringConverter::parseReal(val));
|
---|
| 164 | }
|
---|
| 165 | //-----------------------------------------------------------------------
|
---|
| 166 | String CmdDuration::doGet(const void* target) const
|
---|
| 167 | {
|
---|
| 168 | return StringConverter::toString(
|
---|
| 169 | static_cast<const ParticleEmitter*>(target)->getDuration() );
|
---|
| 170 | }
|
---|
| 171 | void CmdDuration::doSet(void* target, const String& val)
|
---|
| 172 | {
|
---|
| 173 | static_cast<ParticleEmitter*>(target)->setDuration(StringConverter::parseReal(val));
|
---|
| 174 | }
|
---|
| 175 | //-----------------------------------------------------------------------
|
---|
| 176 | String CmdMinDuration::doGet(const void* target) const
|
---|
| 177 | {
|
---|
| 178 | return StringConverter::toString(
|
---|
| 179 | static_cast<const ParticleEmitter*>(target)->getMinDuration() );
|
---|
| 180 | }
|
---|
| 181 | void CmdMinDuration::doSet(void* target, const String& val)
|
---|
| 182 | {
|
---|
| 183 | static_cast<ParticleEmitter*>(target)->setMinDuration(StringConverter::parseReal(val));
|
---|
| 184 | }
|
---|
| 185 | //-----------------------------------------------------------------------
|
---|
| 186 | String CmdMaxDuration::doGet(const void* target) const
|
---|
| 187 | {
|
---|
| 188 | return StringConverter::toString(
|
---|
| 189 | static_cast<const ParticleEmitter*>(target)->getMaxDuration() );
|
---|
| 190 | }
|
---|
| 191 | void CmdMaxDuration::doSet(void* target, const String& val)
|
---|
| 192 | {
|
---|
| 193 | static_cast<ParticleEmitter*>(target)->setMaxDuration(StringConverter::parseReal(val));
|
---|
| 194 | }
|
---|
| 195 | //-----------------------------------------------------------------------
|
---|
| 196 | String CmdRepeatDelay::doGet(const void* target) const
|
---|
| 197 | {
|
---|
| 198 | return StringConverter::toString(
|
---|
| 199 | static_cast<const ParticleEmitter*>(target)->getRepeatDelay() );
|
---|
| 200 | }
|
---|
| 201 | void CmdRepeatDelay::doSet(void* target, const String& val)
|
---|
| 202 | {
|
---|
| 203 | static_cast<ParticleEmitter*>(target)->setRepeatDelay(StringConverter::parseReal(val));
|
---|
| 204 | }
|
---|
| 205 | //-----------------------------------------------------------------------
|
---|
| 206 | String CmdMinRepeatDelay::doGet(const void* target) const
|
---|
| 207 | {
|
---|
| 208 | return StringConverter::toString(
|
---|
| 209 | static_cast<const ParticleEmitter*>(target)->getMinRepeatDelay() );
|
---|
| 210 | }
|
---|
| 211 | void CmdMinRepeatDelay::doSet(void* target, const String& val)
|
---|
| 212 | {
|
---|
| 213 | static_cast<ParticleEmitter*>(target)->setMinRepeatDelay(StringConverter::parseReal(val));
|
---|
| 214 | }
|
---|
| 215 | //-----------------------------------------------------------------------
|
---|
| 216 | String CmdMaxRepeatDelay::doGet(const void* target) const
|
---|
| 217 | {
|
---|
| 218 | return StringConverter::toString(
|
---|
| 219 | static_cast<const ParticleEmitter*>(target)->getMaxRepeatDelay() );
|
---|
| 220 | }
|
---|
| 221 | void CmdMaxRepeatDelay::doSet(void* target, const String& val)
|
---|
| 222 | {
|
---|
| 223 | static_cast<ParticleEmitter*>(target)->setMaxRepeatDelay(StringConverter::parseReal(val));
|
---|
| 224 | }
|
---|
| 225 |
|
---|
| 226 |
|
---|
| 227 |
|
---|
| 228 | }
|
---|
| 229 | }
|
---|
| 230 |
|
---|