Class AdvancedParticleProperties
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
Used to add a set of particle properties to a collectible.
[JsonObject(MemberSerialization.OptIn)]
public class AdvancedParticleProperties : IParticlePropertiesProvider
- Inheritance
-
AdvancedParticleProperties
- Implements
- Inherited Members
- Extension Methods
Fields
Color
When HsvaColor is null, this is used
public int Color
Field Value
HsvaColor
The Hue/Saturation/Value/Alpha for the color of the particle.
[JsonProperty]
public NatFloat[] HsvaColor
Field Value
- NatFloat[]
PosOffset
Offset from the blocks hitboxes top middle position
[JsonProperty]
public NatFloat[] PosOffset
Field Value
- NatFloat[]
basePos
The base position for the particles.
public Vec3d basePos
Field Value
baseVelocity
public Vec3f baseVelocity
Field Value
block
The base block for the particle.
public Block block
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; }
Property Value
BlueEvolve
A transforming Blue value.
[JsonProperty]
public EvolvingNatFloat BlueEvolve { get; set; }
Property Value
Bounciness
The amount of velocity to be kept when this particle collides with something. Directional velocity is multipled by (-Bounciness * 0.65) on any collision.
[JsonProperty]
public float Bounciness { get; set; }
Property Value
ColorByBlock
Whether or not to color the particle by the block it's on.
[JsonProperty]
public bool ColorByBlock { get; set; }
Property Value
DeathParticles
More particles that spawn when this particle dies.
[JsonProperty]
public AdvancedParticleProperties[] DeathParticles { get; set; }
Property Value
DieInAir
Whether or not the particle dies in air.
[JsonProperty]
public bool DieInAir { get; set; }
Property Value
DieInLiquid
Whether or not the particle dies in water.
[JsonProperty]
public bool DieInLiquid { get; set; }
Property Value
DieOnRainHeightmap
If true, particle dies if it falls below the rain height at its given location
[JsonProperty]
public bool DieOnRainHeightmap { get; set; }
Property Value
GravityEffect
The gravity effect on the particle.
[JsonProperty]
public NatFloat GravityEffect { get; set; }
Property Value
GreenEvolve
A transforming Green value.
[JsonProperty]
public EvolvingNatFloat GreenEvolve { get; set; }
Property Value
LifeLength
The life length, in seconds, of the particle.
[JsonProperty]
public NatFloat LifeLength { 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; }
Property Value
OpacityEvolve
A transforming opacity value.
[JsonProperty]
public EvolvingNatFloat OpacityEvolve { get; set; }
Property Value
ParentVelocity
public Vec3f ParentVelocity { get; set; }
Property Value
ParentVelocityWeight
public float ParentVelocityWeight { get; set; }
Property Value
ParticleModel
Sets the base model for the particle.
[JsonProperty]
public EnumParticleModel ParticleModel { get; set; }
Property Value
Pos
Position in the world where the particle should spawn
public Vec3d Pos { get; }
Property Value
Quantity
The quantity of the particles given.
[JsonProperty]
public NatFloat Quantity { get; set; }
Property Value
RandomVelocityChange
Allows each particle to randomly change its velocity over time.
[JsonProperty]
public bool RandomVelocityChange { get; set; }
Property Value
RedEvolve
A transforming Red value.
[JsonProperty]
public EvolvingNatFloat RedEvolve { get; set; }
Property Value
SecondaryParticles
More particles that spawn from this particle over time. See SecondarySpawnInterval to control rate.
[JsonProperty]
public AdvancedParticleProperties[] SecondaryParticles { get; set; }
Property Value
SecondarySpawnInterval
The inverval that the SecondaryParticles spawn.
[JsonProperty]
public NatFloat SecondarySpawnInterval { get; set; }
Property Value
SelfPropelled
Whether or not the particle is self propelled.
[JsonProperty]
public bool SelfPropelled { get; set; }
Property Value
Size
The size of the particles given.
[JsonProperty]
public NatFloat Size { get; set; }
Property Value
SizeEvolve
A transforming Size value.
[JsonProperty]
public EvolvingNatFloat SizeEvolve { get; set; }
Property Value
SwimOnLiquid
Whether or not the particle floats on liquids.
[JsonProperty]
public bool SwimOnLiquid { get; set; }
Property Value
TerrainCollision
Whether or not the particle collides with the terrain.
[JsonProperty]
public bool TerrainCollision { get; set; }
Property Value
Velocity
The velocity of the particles.
[JsonProperty]
public NatFloat[] Velocity { get; set; }
Property Value
- NatFloat[]
VelocityEvolve
A dynamic velocity value.
[JsonProperty]
public EvolvingNatFloat[] VelocityEvolve { get; set; }
Property Value
VertexFlags
The level of glow in the particle.
[JsonProperty]
public int VertexFlags { get; set; }
Property Value
WindAffectednes
How much the particles are affected by wind.
[JsonProperty]
public float WindAffectednes { get; set; }
Property Value
WindAffectednesAtPos
public float WindAffectednesAtPos { get; set; }
Property Value
Methods
BeginParticle()
Begins the advanced particle.
public void BeginParticle()
Clone()
public AdvancedParticleProperties Clone()
Returns
FromBytes(BinaryReader, IWorldAccessor)
For reading from the network
public void FromBytes(BinaryReader reader, IWorldAccessor resolver)
Parameters
reader
BinaryReaderresolver
IWorldAccessor
GetRgbaColor(ICoreClientAPI)
Converts the color to RGBA.
public int GetRgbaColor(ICoreClientAPI capi)
Parameters
capi
ICoreClientAPIThe Core Client API.
Returns
- int
The set RGBA color.
GetVelocity(Vec3d)
Gets the velocity of the particle.
public Vec3f GetVelocity(Vec3d pos)
Parameters
pos
Vec3d
Returns
Init(ICoreAPI)
Initializes the particle.
public void Init(ICoreAPI api)
Parameters
api
ICoreAPIThe core API.
PrepareForSecondarySpawn(ParticleBase)
prepares the particle for secondary spawning.
public void PrepareForSecondarySpawn(ParticleBase particleInstance)
Parameters
particleInstance
ParticleBase
ToBytes(BinaryWriter)
For sending over the network
public void ToBytes(BinaryWriter writer)
Parameters
writer
BinaryWriter
createFromBytes(BinaryReader, IWorldAccessor)
public static AdvancedParticleProperties createFromBytes(BinaryReader reader, IWorldAccessor resolver)
Parameters
reader
BinaryReaderresolver
IWorldAccessor