Class CollectibleParticleProperties
- Namespace
- Vintagestory.API.Common
- Assembly
- VintagestoryAPI.dll
Abstract class used for BlockVoxelParticles and ItemVoxelParticles
public abstract class CollectibleParticleProperties : IParticlePropertiesProvider
- Inheritance
-
CollectibleParticleProperties
- Implements
- Derived
- Inherited Members
- Extension Methods
Fields
api
public ICoreAPI api
Field Value
rand
public Random rand
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
Return null or 1 if opacity should remain unchanged over time. lifetimeLeft is always a value between 0 and 1
public virtual EvolvingNatFloat BlueEvolve { get; }
Property Value
Bounciness
public float Bounciness { get; set; }
Property Value
DeathParticles
The particle to spawn upon the particle death.
public IParticlePropertiesProvider[] DeathParticles { get; }
Property Value
DieInAir
Whether the particle should despawn when in contact with air (e.g. for water bubbles)
public virtual bool DieInAir { get; }
Property Value
DieInLiquid
Whether the particle should despawn when in contact with liquids
public virtual 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 virtual float GravityEffect { get; }
Property Value
GreenEvolve
Return null or 1 if opacity should remain unchanged over time. lifetimeLeft is always a value between 0 and 1
public virtual EvolvingNatFloat GreenEvolve { get; }
Property Value
LifeLength
How long the particle should live (default = 1)
public virtual float LifeLength { get; }
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 virtual EvolvingNatFloat OpacityEvolve { get; }
Property Value
ParentVelocity
public Vec3f ParentVelocity { get; set; }
Property Value
ParentVelocityWeight
public float ParentVelocityWeight { get; set; }
Property Value
ParticleModel
Cube or Quad?
public abstract EnumParticleModel ParticleModel { get; }
Property Value
Pos
Position in the world where the particle should spawn
public abstract 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 abstract float Quantity { get; }
Property Value
RandomVelocityChange
public virtual 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 virtual EvolvingNatFloat RedEvolve { get; }
Property Value
SecondaryParticles
The secondary particle properties. Secondary particles are particles that are emitted from an in-flight particle.
public virtual IParticlePropertiesProvider[] SecondaryParticles { get; }
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 virtual float SecondarySpawnInterval { get; }
Property Value
SelfPropelled
If true, a particle will restore it's initial velocity once it's obstruction has been cleared e.g. Smokes will start flying upwards again if is currently stuck under a block and the block is removed
public virtual bool SelfPropelled { get; }
Property Value
Size
Size of the particle
public virtual float Size { get; }
Property Value
SizeEvolve
Size change over time
public virtual EvolvingNatFloat SizeEvolve { get; }
Property Value
SwimOnLiquid
public virtual bool SwimOnLiquid { get; }
Property Value
TerrainCollision
If true, the particle will collide with the terrain
public virtual bool TerrainCollision { get; }
Property Value
VelocityEvolve
Velocity change over time (acts as a multiplier to the velocity)
public virtual EvolvingNatFloat[] VelocityEvolve { get; }
Property Value
VertexFlags
See also VertexFlags
public abstract int VertexFlags { 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()
ColorByBlock()
public virtual Block ColorByBlock()
Returns
FromBytes(BinaryReader, IWorldAccessor)
For reading from the network
public virtual void FromBytes(BinaryReader reader, IWorldAccessor resolver)
Parameters
reader
BinaryReaderresolver
IWorldAccessor
GetRgbaColor(ICoreClientAPI)
The particles Rgba Color
public abstract int GetRgbaColor(ICoreClientAPI capi)
Parameters
capi
ICoreClientAPI
Returns
GetVelocity(Vec3d)
In what direction should the particle fly/fall
public abstract Vec3f GetVelocity(Vec3d pos)
Parameters
pos
Vec3d
Returns
Init(ICoreAPI)
Called before the particle provider is used for particle creation
public virtual void Init(ICoreAPI api)
Parameters
api
ICoreAPI
PrepareForSecondarySpawn(ParticleBase)
Updates instance related state for secondary particles based on the given parent particle instance
public virtual void PrepareForSecondarySpawn(ParticleBase particleInstance)
Parameters
particleInstance
ParticleBaseThe parent IParticleInstance from which this secondary particle is being spawned
RandomBlockPos(IBlockAccessor, BlockPos, Block, BlockFacing)
public Vec3d RandomBlockPos(IBlockAccessor blockAccess, BlockPos pos, Block block, BlockFacing facing = null)
Parameters
blockAccess
IBlockAccessorpos
BlockPosblock
Blockfacing
BlockFacing
Returns
ToBytes(BinaryWriter)
For sending over the network
public virtual void ToBytes(BinaryWriter writer)
Parameters
writer
BinaryWriter
UseLighting()
public virtual bool UseLighting()