Class SimpleParticleProperties
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
A configurable implementation of IParticlePropertiesProvider
public class SimpleParticleProperties : IParticlePropertiesProvider
- Inheritance
-
SimpleParticleProperties
- Implements
- Inherited Members
- Extension Methods
Constructors
SimpleParticleProperties()
public SimpleParticleProperties()
SimpleParticleProperties(float, float, int, Vec3d, Vec3d, Vec3f, Vec3f, float, float, float, float, EnumParticleModel)
public SimpleParticleProperties(float minQuantity, float maxQuantity, int color, Vec3d minPos, Vec3d maxPos, Vec3f minVelocity, Vec3f maxVelocity, float lifeLength = 1, float gravityEffect = 1, float minSize = 1, float maxSize = 1, EnumParticleModel model = EnumParticleModel.Cube)
Parameters
minQuantity
floatmaxQuantity
floatcolor
intminPos
Vec3dmaxPos
Vec3dminVelocity
Vec3fmaxVelocity
Vec3flifeLength
floatgravityEffect
floatminSize
floatmaxSize
floatmodel
EnumParticleModel
Fields
AddPos
public Vec3d AddPos
Field Value
AddQuantity
public float AddQuantity
Field Value
AddVelocity
public Vec3f AddVelocity
Field Value
ClimateColorMap
The color map for climate color mapping. Leave null for no coloring by climate
public string ClimateColorMap
Field Value
Color
public int Color
Field Value
ColorByBlock
public Block ColorByBlock
Field Value
LifeLength
public float LifeLength
Field Value
MaxSize
public float MaxSize
Field Value
MinPos
public Vec3d MinPos
Field Value
MinQuantity
public float MinQuantity
Field Value
MinSize
public float MinSize
Field Value
MinVelocity
public Vec3f MinVelocity
Field Value
SeasonColorMap
The color map for season color mapping. Leave null for no coloring by season
public string SeasonColorMap
Field Value
SelfPropelled
public bool SelfPropelled
Field Value
WindAffectednes
public float WindAffectednes
Field Value
addLifeLength
public float addLifeLength
Field Value
randTL
public static ThreadLocal<Random> randTL
Field Value
tmpPos
protected Vec3d tmpPos
Field Value
Properties
Async
If true, will be be spawned in the async particle system, which does not affect main game performance, recommended for large quantities of particles, slightly less optimal for particles that spawn very often
public bool Async { get; set; }
Property Value
BlueEvolve
Return null or 1 if opacity should remain unchanged over time. lifetimeLeft is always a value between 0 and 1
public EvolvingNatFloat BlueEvolve { get; set; }
Property Value
Bounciness
public float Bounciness { get; set; }
Property Value
DeathParticles
The particle to spawn upon the particle death.
public IParticlePropertiesProvider[] DeathParticles { get; set; }
Property Value
DieInAir
Whether the particle should despawn when in contact with air (e.g. for water bubbles)
public bool DieInAir { get; }
Property Value
DieInLiquid
Whether the particle should despawn when in contact with liquids
public bool DieInLiquid { get; }
Property Value
DieOnRainHeightmap
If true, particle dies if it falls below the rain height at its given location
public bool DieOnRainHeightmap { get; set; }
Property Value
GravityEffect
How strongly the particle is affected by gravity (0 = no gravity applied)
public float GravityEffect { get; set; }
Property Value
GreenEvolve
Return null or 1 if opacity should remain unchanged over time. lifetimeLeft is always a value between 0 and 1
public EvolvingNatFloat GreenEvolve { get; set; }
Property Value
LightEmission
If this particle emits light, this is its RGBA. Does not actually brighten the scene around it, but prevents incorrect lighting of particles when everything else around it is dark
public int LightEmission { get; set; }
Property Value
OpacityEvolve
Return null or 1 if opacity should remain unchanged over time. lifetimeLeft is always a value between 0 and 1
public EvolvingNatFloat OpacityEvolve { get; set; }
Property Value
ParentVelocity
public Vec3f ParentVelocity { get; set; }
Property Value
ParentVelocityWeight
public float ParentVelocityWeight { get; set; }
Property Value
ParticleModel
Cube or Quad?
public EnumParticleModel ParticleModel { get; set; }
Property Value
Pos
Position in the world where the particle should spawn
public virtual Vec3d Pos { get; }
Property Value
Quantity
How many particles should spawn? For every particle spawned, all of belows methods are called once. E.g. if quantity is 10, GetPos(), GetVelocity(),... is called 10 times.
public float Quantity { get; }
Property Value
RandomVelocityChange
public bool RandomVelocityChange { get; set; }
Property Value
RedEvolve
Return null or 1 if opacity should remain unchanged over time. lifetimeLeft is always a value between 0 and 1
public EvolvingNatFloat RedEvolve { get; set; }
Property Value
SecondaryParticles
The secondary particle properties. Secondary particles are particles that are emitted from an in-flight particle.
public IParticlePropertiesProvider[] SecondaryParticles { get; set; }
Property Value
SecondarySpawnInterval
Determines the interval of time that must elapse during it's parent particle's lifetime before this one will spawn. This is only honored if this particle is defined as a secondary particle.
public float SecondarySpawnInterval { get; }
Property Value
ShouldDieInAir
public bool ShouldDieInAir { get; set; }
Property Value
ShouldDieInLiquid
public bool ShouldDieInLiquid { get; set; }
Property Value
ShouldSwimOnLiquid
public bool ShouldSwimOnLiquid { get; set; }
Property Value
Size
Size of the particle
public float Size { get; }
Property Value
SizeEvolve
Size change over time
public EvolvingNatFloat SizeEvolve { get; set; }
Property Value
SwimOnLiquid
public bool SwimOnLiquid { get; }
Property Value
TerrainCollision
If true, the particle will collide with the terrain
public bool TerrainCollision { get; }
Property Value
VelocityEvolve
Velocity change over time (acts as a multiplier to the velocity)
public EvolvingNatFloat[] VelocityEvolve { get; }
Property Value
VertexFlags
See also VertexFlags
public int VertexFlags { get; set; }
Property Value
WindAffected
public bool WindAffected { get; set; }
Property Value
WithTerrainCollision
public bool WithTerrainCollision { get; set; }
Property Value
rand
public static Random rand { get; }
Property Value
Methods
BeginParticle()
Called just before a new particle is being created. You can use this to produce e.g. alternating kinds of particles
public void BeginParticle()
Clone(IWorldAccessor)
public SimpleParticleProperties Clone(IWorldAccessor worldForResovle)
Parameters
worldForResovle
IWorldAccessor
Returns
FromBytes(BinaryReader, IWorldAccessor)
For reading from the network
public void FromBytes(BinaryReader reader, IWorldAccessor resolver)
Parameters
reader
BinaryReaderresolver
IWorldAccessor
GetRgbaColor(ICoreClientAPI)
The particles Rgba Color
public int GetRgbaColor(ICoreClientAPI capi)
Parameters
capi
ICoreClientAPI
Returns
GetVelocity(Vec3d)
In what direction should the particle fly/fall
public Vec3f GetVelocity(Vec3d pos)
Parameters
pos
Vec3d
Returns
Init(ICoreAPI)
Called before the particle provider is used for particle creation
public void Init(ICoreAPI api)
Parameters
api
ICoreAPI
PrepareForSecondarySpawn(ParticleBase)
Updates instance related state for secondary particles based on the given parent particle instance
public void PrepareForSecondarySpawn(ParticleBase particleInstance)
Parameters
particleInstance
ParticleBaseThe parent IParticleInstance from which this secondary particle is being spawned
ToBytes(BinaryWriter)
For sending over the network
public void ToBytes(BinaryWriter writer)
Parameters
writer
BinaryWriter
UseLighting()
public bool UseLighting()