public void InitDefault() { ArraySize.SetValue(Vector3.One); ArrayModulo.SetValue(1); var colorAnim = new MyAnimatedPropertyVector4(); colorAnim.AddKey(0, Vector4.One); colorAnim.AddKey(0.33f, Vector4.One); colorAnim.AddKey(0.66f, Vector4.One); colorAnim.AddKey(1, Vector4.One); Color.AddKey(0, colorAnim); var colorIntensityAnim = new MyAnimatedPropertyFloat(); colorIntensityAnim.AddKey(0, 1.0f); colorIntensityAnim.AddKey(0.33f, 1.0f); colorIntensityAnim.AddKey(0.66f, 1.0f); colorIntensityAnim.AddKey(1, 1.0f); ColorIntensity.AddKey(0, colorIntensityAnim); Offset.SetValue(new Vector3(0, 0, 0)); Direction.SetValue(new Vector3(0, 0, -1)); var radiusAnim = new MyAnimatedPropertyFloat(); radiusAnim.AddKey(0, 0.1f); radiusAnim.AddKey(0.33f, 0.1f); radiusAnim.AddKey(0.66f, 0.1f); radiusAnim.AddKey(1, 0.1f); Radius.AddKey(0, radiusAnim); Life.SetValue(1); StreakMultiplier.SetValue(4); AnimationFrameTime.SetValue(1); Enabled.SetValue(true); EmitterSize.AddKey(0, new Vector3(0.0f, 0.0f, 0.0f)); EmitterSizeMin.AddKey(0, 0.0f); DirectionCone.AddKey(0, 0.0f); DirectionConeVar.AddKey(0, 0.0f); Velocity.AddKey(0, 1.0f); VelocityVar.AddKey(0, 0.0f); ParticlesPerSecond.AddKey(0, 1000.0f); Material.SetValue(MyTransparentMaterials.GetMaterial("WhiteBlock")); SoftParticleDistanceScale.SetValue(1); Bounciness.SetValue(0.5f); ColorVar.SetValue(0); HueVar.SetValue(0); OITWeightFactor.SetValue(1f); TargetCoverage.SetValue(1f); }
/// <summary> /// Only for some testing values /// </summary> public void InitDefault() { Birth.AddKey(0, 1.0f); Life.AddKey(0, 10.0f); Thickness.AddKey(0, 1.0f); Velocity.AddKey(0, new Vector3(0, 1, 0)); MyAnimatedPropertyVector4 colorKey = new MyAnimatedPropertyVector4(Color.Name); colorKey.AddKey(0, new Vector4(1, 0, 0, 1)); colorKey.AddKey(1, new Vector4(0, 0, 1, 1)); Color.AddKey(0, colorKey); MyAnimatedPropertyFloat radiusKey = new MyAnimatedPropertyFloat(Radius.Name); radiusKey.AddKey(0, 1.0f); Radius.AddKey(0, radiusKey); MyAnimatedPropertyTransparentMaterial materialKey = new MyAnimatedPropertyTransparentMaterial(Material.Name); materialKey.AddKey(0, MyTransparentMaterials.GetMaterial("Smoke")); Material.AddKey(0, materialKey); LODBirth.AddKey(0, 1.0f); LODRadius.AddKey(0, 1.0f); UseLayerSorting.SetValue(false); SortLayer.SetValue(-1); }
public void InitDefault() { Birth.AddKey(0, 1.0f); Life.AddKey(0, 10.0f); Thickness.AddKey(0, 1.0f); Velocity.AddKey(0, new Vector3(0, 1, 0)); MyAnimatedPropertyVector4 colorKey = new MyAnimatedPropertyVector4(Color.Name); colorKey.AddKey(0, new Vector4(1, 0, 0, 1)); colorKey.AddKey(1, new Vector4(0, 0, 1, 1)); Color.AddKey(0, colorKey); MyAnimatedPropertyFloat radiusKey = new MyAnimatedPropertyFloat(Radius.Name); radiusKey.AddKey(0, 1.0f); Radius.AddKey(0, radiusKey); MyAnimatedPropertyTransparentMaterial materialKey = new MyAnimatedPropertyTransparentMaterial(Material.Name); materialKey.AddKey(0, MyTransparentMaterials.GetMaterial("Smoke")); Material.AddKey(0, materialKey); LODBirth.AddKey(0, 1.0f); LODBirth.AddKey(MyConstants.MAX_PARTICLE_DISTANCE_DEFAULT, 0f); LODRadius.AddKey(0, 1.0f); PivotDistVar.SetValue(1.0f); AccelerationVar.SetValue(0.0f); UseLayerSorting.SetValue(false); SortLayer.SetValue(-1); }
public void InitDefault() { ArraySize.SetValue(Vector3.One); ArrayModulo.SetValue(1); var colorAnim = new MyAnimatedPropertyVector4(); colorAnim.AddKey(0, Vector4.One); colorAnim.AddKey(0.33f, Vector4.One); colorAnim.AddKey(0.66f, Vector4.One); colorAnim.AddKey(1, Vector4.One); Color.AddKey(0, colorAnim); Velocity.SetValue(new Vector3(0, 0, -1)); var radiusAnim = new MyAnimatedPropertyFloat(); radiusAnim.AddKey(0, 0.1f); radiusAnim.AddKey(0.33f, 0.1f); radiusAnim.AddKey(0.66f, 0.1f); radiusAnim.AddKey(1, 0.1f); Radius.AddKey(0, radiusAnim); Life.SetValue(1); StreakMultiplier.SetValue(4); AnimationFrameTime.SetValue(1); Enabled.SetValue(true); ParticlesPerSecond.SetValue(30000); Material.SetValue(MyTransparentMaterials.GetMaterial("WhiteBlock")); SoftParticleDistanceScale.SetValue(1); Bounciness.SetValue(0.5f); OITWeightFactor.SetValue(1f); }
public void Init() { System.Diagnostics.Debug.Assert(Birth == null); AddProperty(MyGenerationPropertiesEnum.Birth, new MyAnimatedPropertyFloat("Birth")); AddProperty(MyGenerationPropertiesEnum.BirthVar, new MyConstPropertyFloat("Birth var")); AddProperty(MyGenerationPropertiesEnum.Life, new MyAnimatedPropertyFloat("Life")); AddProperty(MyGenerationPropertiesEnum.LifeVar, new MyConstPropertyFloat("Life var")); AddProperty(MyGenerationPropertiesEnum.Velocity, new MyAnimatedPropertyVector3("Velocity")); AddProperty(MyGenerationPropertiesEnum.VelocityDir, new MyConstPropertyEnum("Velocity dir", typeof(MyVelocityDirEnum), s_velocityDirStrings)); AddProperty(MyGenerationPropertiesEnum.Angle, new MyAnimatedPropertyFloat("Angle")); AddProperty(MyGenerationPropertiesEnum.AngleVar, new MyConstPropertyFloat("Angle var")); AddProperty(MyGenerationPropertiesEnum.RotationSpeed, new MyAnimatedPropertyFloat("Rotation speed")); AddProperty(MyGenerationPropertiesEnum.RotationSpeedVar, new MyConstPropertyFloat("Rotation speed var")); AddProperty(MyGenerationPropertiesEnum.Radius, new MyAnimatedProperty2DFloat("Radius")); AddProperty(MyGenerationPropertiesEnum.RadiusVar, new MyAnimatedPropertyFloat("Radius var")); AddProperty(MyGenerationPropertiesEnum.Color, new MyAnimatedProperty2DVector4("Color")); AddProperty(MyGenerationPropertiesEnum.ColorVar, new MyAnimatedPropertyFloat("Color var")); AddProperty(MyGenerationPropertiesEnum.Material, new MyAnimatedProperty2DTransparentMaterial("Material", MyTransparentMaterialInterpolator.Switch)); AddProperty(MyGenerationPropertiesEnum.ParticleType, new MyConstPropertyEnum("Particle type", typeof(MyParticleTypeEnum), s_particleTypeStrings)); AddProperty(MyGenerationPropertiesEnum.Thickness, new MyAnimatedPropertyFloat("Thickness")); AddProperty(MyGenerationPropertiesEnum.Enabled, new MyConstPropertyBool("Enabled")); Enabled.SetValue(true); AddProperty(MyGenerationPropertiesEnum.BlendTextures, new MyConstPropertyBool("Blend textures")); BlendTextures.SetValue(true); AddProperty(MyGenerationPropertiesEnum.EnableCustomRadius, new MyConstPropertyBool("Enable custom radius")); AddProperty(MyGenerationPropertiesEnum.EnableCustomVelocity, new MyConstPropertyBool("Enable custom velocity")); AddProperty(MyGenerationPropertiesEnum.EnableCustomBirth, new MyConstPropertyBool("Enable custom birth")); AddProperty(MyGenerationPropertiesEnum.OnDie, new MyConstPropertyGenerationIndex("OnDie")); OnDie.SetValue(-1); AddProperty(MyGenerationPropertiesEnum.OnLife, new MyConstPropertyGenerationIndex("OnLife")); OnLife.SetValue(-1); AddProperty(MyGenerationPropertiesEnum.LODBirth, new MyAnimatedPropertyFloat("LODBirth")); AddProperty(MyGenerationPropertiesEnum.LODRadius, new MyAnimatedPropertyFloat("LODRadius")); AddProperty(MyGenerationPropertiesEnum.MotionInheritance, new MyAnimatedPropertyFloat("Motion inheritance")); AddProperty(MyGenerationPropertiesEnum.UseLayerSorting, new MyConstPropertyBool("Use layer sorting")); AddProperty(MyGenerationPropertiesEnum.SortLayer, new MyConstPropertyInt("Sort layer")); AddProperty(MyGenerationPropertiesEnum.AlphaAnisotropic, new MyConstPropertyBool("Alpha anisotropic")); AddProperty(MyGenerationPropertiesEnum.Gravity, new MyConstPropertyFloat("Gravity")); AddProperty(MyGenerationPropertiesEnum.PivotRotation, new MyAnimatedProperty2DVector3("Pivot rotation")); AddProperty(MyGenerationPropertiesEnum.PivotDistance, new MyAnimatedProperty2DFloat("Pivot distance")); AddProperty(MyGenerationPropertiesEnum.PivotDistVar, new MyConstPropertyFloat("Pivot distance var")); AddProperty(MyGenerationPropertiesEnum.Acceleration, new MyAnimatedProperty2DVector3("Acceleration")); AddProperty(MyGenerationPropertiesEnum.AccelerationVar, new MyConstPropertyFloat("Acceleration var")); AddProperty(MyGenerationPropertiesEnum.AlphaCutout, new MyAnimatedProperty2DFloat("Alpha cutout")); AddProperty(MyGenerationPropertiesEnum.BirthPerFrame, new MyAnimatedPropertyFloat("Birth per frame")); AddProperty(MyGenerationPropertiesEnum.RadiusBySpeed, new MyConstPropertyFloat("Radius by speed")); AddProperty(MyGenerationPropertiesEnum.ColorIntensity, new MyAnimatedPropertyFloat("Color intensity")); Thickness.AddKey(0, 1.0f); LODBirth.AddKey(0, 1.0f); LODRadius.AddKey(0, 1.0f); UseLayerSorting.SetValue(false); SortLayer.SetValue(-1); PivotDistVar.SetValue(1); AccelerationVar.SetValue(0); ColorIntensity.AddKey(0, 1.0f); m_emitter.Init(); }