3 using SiliconStudio.Paradox.Effects;
4 using SiliconStudio.Paradox.Engine;
5 using SiliconStudio.Paradox.EntityModel;
6 using SiliconStudio.Paradox.Games;
7 using SiliconStudio.Paradox.Games.Mathematics;
8 using SiliconStudio.Paradox.Games.Serialization.Contents;
9 using Paradox.Framework.Shaders;
13 [ContentSerializer(typeof(EntityComponentContentSerializer<SmokeParticleEmitterComponent>))]
19 Type = ParticleEmitterType.GpuStatic;
20 Shader =
new ShaderClassSource(
"ParticleUpdaterSmoke");
28 bool isUptoDate =
true;
39 var random =
new Random();
40 var particlesBuffer = (ScriptParticleSmoke.ParticleData[])
ParticleData;
42 for (
int i = 0; i < particlesBuffer.Length; i++)
44 particlesBuffer[i] =
new ScriptParticleSmoke.ParticleData
46 Position = description.Position,
47 Velocity = (Half3)(description.Velocity +
Vector3.Modulate(
new Vector3((
float)(random.NextDouble() * 2 - 1), (
float)(random.NextDouble() * 2 - 1), (float)(random.NextDouble())), description.Scatter)),
48 Size = (
Half)description.InitialSize,
49 Time = (
float)random.NextDouble() * description.MaxTime,
50 Opacity = (
Half)description.Opacity,
52 TimeStep = (
Half)10.0f,
54 particlesBuffer[i].Position += ((
Vector3)particlesBuffer[i].Velocity) * particlesBuffer[i].Time * 100.0f / 1000.0f;
64 return Parameters.TryGet(ScriptParticleSmoke.SmokeEmitterKey);
68 Parameters.Set(ScriptParticleSmoke.SmokeEmitterKey, value);
int Count
Gets or sets the particle count.
SiliconStudio.Paradox.Games.Mathematics.Half4 Half4
SmokeEmitterDescription Description
int ParticleElementSize
Gets or sets the size of the particle element.
ShaderClassSource Shader
Gets or sets the shader.
SiliconStudio.Paradox.Games.Mathematics.Half Half
ParticleEmitterType Type
Gets or sets the type of this emitter..
Array ParticleData
Gets or sets the particle data.
SiliconStudio.Core.Mathematics.Vector3 Vector3
SmokeParticleEmitterComponent()
Action< ParticleEmitterComponent > UpdateData