Changeset 5447 in orxonox.OLD for trunk/src/lib/particles
- Timestamp:
- Oct 29, 2005, 1:14:24 PM (19 years ago)
- Location:
- trunk/src/lib/particles
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/particles/particle_engine.cc
r5445 r5447 18 18 #include "particle_engine.h" 19 19 20 #include "particle_system.h" 21 #include "particle_emitter.h" 20 #include "class_list.h" 22 21 23 22 #include "list.h" … … 120 119 } 121 120 122 #include "class_list.h"123 121 /** 124 122 * @brief Connects a ParticleSystem to a ParticleSystem thus emitting Particles. … … 216 214 } 217 215 216 217 /** 218 * removes a Connection between an Emitter and a System 219 * @param connection the connection to remove 220 * 221 * \see bool ParticleEngine::breakConnection(ParticleEmitter* emitter, ParticleSystem* system) 222 */ 223 bool ParticleEngine::breakConnection(ParticleConnection* connection) 224 { 225 this->connectionList->remove(connection); 226 return true; 227 } 228 218 229 /** 219 230 * removes a Connection between an Emitter and a System … … 221 232 * @param system The system of the connection to remove 222 233 * @returns true, if the connection was broken, false if the conntection was not found 223 224 234 * 235 * only if both system and emitter are in the connection the Connection will be broken 225 236 */ 226 237 bool ParticleEngine::breakConnection(ParticleEmitter* emitter, ParticleSystem* system) … … 245 256 /** 246 257 * removes a Connection between an Emitter and a System 247 * @param connection the connection to remove 248 249 \see bool ParticleEngine::breakConnection(ParticleEmitter* emitter, ParticleSystem* system) 250 */ 251 bool ParticleEngine::breakConnection(ParticleConnection* connection) 252 { 253 this->connectionList->remove(connection); 254 return true; 255 } 256 258 * @param emitter The emitter of the connections to remove 259 * @returns the count of connections that were broken, 0 if no conntection was not found 260 */ 261 unsigned int ParticleEngine::breakConnections(ParticleEmitter* emitter) 262 { 263 unsigned int retVal = 0; 264 // look, if we have already added this connection 265 tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator(); 266 ParticleConnection* tmpConnection = tmpConIt->firstElement(); 267 while(tmpConnection) 268 { 269 if (tmpConnection->emitter == emitter) 270 { 271 this->breakConnection(tmpConnection); 272 retVal++; 273 } 274 tmpConnection = tmpConIt->nextElement(); 275 } 276 delete tmpConIt; 277 return retVal; 278 } 279 280 281 /** 282 * removes a Connection between an Emitter and a System 283 * @param system The system of the connections to remove 284 * @returns the count of connections that were broken, 0 if no conntection was not found 285 */ 286 unsigned int ParticleEngine::breakConnections(ParticleSystem* system) 287 { 288 unsigned int retVal = 0; 289 // look, if we have already added this connection 290 tIterator<ParticleConnection>* tmpConIt = connectionList->getIterator(); 291 ParticleConnection* tmpConnection = tmpConIt->firstElement(); 292 while(tmpConnection) 293 { 294 if (tmpConnection->system == system) 295 { 296 this->breakConnection(tmpConnection); 297 retVal++; 298 } 299 tmpConnection = tmpConIt->nextElement(); 300 } 301 delete tmpConIt; 302 return retVal; 303 } 257 304 258 305 /** … … 406 453 407 454 } 455 -
trunk/src/lib/particles/particle_engine.h
r5445 r5447 50 50 bool removeSystem(ParticleSystem* system); 51 51 bool removeEmitter(ParticleEmitter* emitter); 52 bool breakConnection(ParticleConnection* connection); 52 53 bool breakConnection(ParticleEmitter* emitter, ParticleSystem* system); 53 bool breakConnection(ParticleConnection* connection); 54 unsigned int breakConnections(ParticleEmitter* emitter); 55 unsigned int breakConnections(ParticleSystem* system); 54 56 55 57 ParticleSystem* getSystemByNumber(unsigned int number) const;
Note: See TracChangeset
for help on using the changeset viewer.