1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 |
--Particle System
ZO_ParticleSystem . particleClassToPool = { }
return obj
end
if not ZO_ParticleSystem . particleClassToPool [ particleClass ] then
end
end
ZO_ParticleSystem . particleClassToPool [ particleClass ] = pool
end
end
end
if particlesPerSecond > 0 then
else
end
end
end
end
end
--This function takes N parameter names and one value generator. The result of the value generator will be applied to the
--named parameters when the particle is created. A simple example is, SetParticleParameter("alpha", ZO_UniformRangeGenerator:New(0, 1)).
--This would set the parameter "alpha" to a random value between 0 and 1 on creation. For a more complex example,
--SetParticleParameter("x", "y", "z", ZO_RandomSpherePoint:New(10)). This would generate a random point on a sphere of size 10 and then
--set each of "x", "y", and "z" on the particle. This allows for one generator to produce multiple linked values. You can also use a direct
--value instead of using a generator class if you just want to use the value always. For example, SetParticle("scale", 1.5).
if numArguments >= 2 then
--See if we already have a generator for these parameter names. We assume that they won't do something like setting generators for
--both "x" and "x" , "y".
local existingKey
for i = 1 , numArguments - 1 do
break
end
end
existingKey = parameterNames
break
end
end
local parameterNames
if existingKey then
parameterNames = existingKey
else
parameterNames = { }
for i = 1 , numArguments - 1 do
end
end
end
end
else
end
end
for particleIndex = 1 , numParticlesToSpawn do
if valueGeneratorIsObject then
end
if valueGeneratorIsObject then
else
end
end
end
end
end
end
end
do
local g_removeParticles = { }
local MAX_PARTICLES_TO_SPAWN_PER_FRAME = 300
if durationS then
end
end
end
else
--Spawn New Particles
end
else
local begin = false
if deltaS < 1 then
if timeInCycleS > lastTimeInCycleS then
begin = true
end
else
if lastTimeInCycleS <= ( self . burstPhaseS + self . burstCycleDurationS ) and timeInCycleS > self . burstPhaseS then
begin = true
end
end
end
if begin then
end
end
end
end
end
--Any "partial" particles that are left over we store off as unused delta time and then add that into the next update.
self . unusedDeltaS = ( deltaS + self . unusedDeltaS ) - numFullParticlesToSpawn * self . secondsBetweenParticles
end
end
--Update Particles
else
end
end
--Remove Dead Particles
if # g_removeParticles then
end
end
end
end
--Stop and kill all particles
end
end
--Stop making new particles but let existing particles finish
end
end
--Scene Graph Particle System
end
end
end
--Control Particle System
ZO_ControlParticleSystem = ZO_ParticleSystem
--Particle System Manager
return obj
end
EVENT_MANAGER : RegisterForUpdate ( "ZO_ParticleSystemManager" , 0 , function ( timeMS ) self : OnUpdate ( timeMS / 1000 ) end )
end
end
end
end
if searchParticleSystem == particleSystem then
break
end
end
end
textureControl . key = key
return textureControl
end
end
|