Table of Contents

Class ParticlesProviderBase

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

A base class for all particle providers.

public abstract class ParticlesProviderBase : IParticlePropertiesProvider
Inheritance
ParticlesProviderBase
Implements
Derived
Inherited Members

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

bool

BlueEvolve

Gets the evolving blue value of the particle.

public virtual EvolvingNatFloat BlueEvolve { get; }

Property Value

EvolvingNatFloat

Bounciness

public float Bounciness { get; set; }

Property Value

float

DeathParticles

Gets the death particle for this type of particle.

public IParticlePropertiesProvider[] DeathParticles { get; }

Property Value

IParticlePropertiesProvider[]

DieInAir

Whether or not the particle dies in air.

public virtual bool DieInAir { get; }

Property Value

bool

DieInLiquid

Determines whether or not the particle dies in liquid

public virtual bool DieInLiquid { get; }

Property Value

bool

DieOnRainHeightmap

If true, particle dies if it falls below the rain height at its given location

public bool DieOnRainHeightmap { get; set; }

Property Value

bool

GravityEffect

Gets the gravity effect on the particle.

public virtual float GravityEffect { get; }

Property Value

float

GreenEvolve

Gets the evolving green value of the particle.

public virtual EvolvingNatFloat GreenEvolve { get; }

Property Value

EvolvingNatFloat

LifeLength

gets the life length of the particle.

public virtual float LifeLength { get; }

Property Value

float

OpacityEvolve

Gets the evolving opacity value of the particle.

public virtual EvolvingNatFloat OpacityEvolve { get; }

Property Value

EvolvingNatFloat

An evolving value based on opacity.

ParentVelocity

public Vec3f ParentVelocity { get; set; }

Property Value

Vec3f

ParentVelocityWeight

public float ParentVelocityWeight { get; set; }

Property Value

float

ParticleModel

Gets the model type of the particle.

public virtual EnumParticleModel ParticleModel { get; }

Property Value

EnumParticleModel

Pos

Gets the position of particles.

public virtual Vec3d Pos { get; }

Property Value

Vec3d

Quantity

Gets the quantity of particles.

public virtual float Quantity { get; }

Property Value

float

RandomVelocityChange

public bool RandomVelocityChange { get; set; }

Property Value

bool

RedEvolve

Gets the evolving red value of the particle.

public virtual EvolvingNatFloat RedEvolve { get; }

Property Value

EvolvingNatFloat

SecondaryParticles

Gets the secondary particle type for this particle.

public virtual IParticlePropertiesProvider[] SecondaryParticles { get; }

Property Value

IParticlePropertiesProvider[]

SecondarySpawnInterval

Gets the secondary particle spawn interval.

public virtual float SecondarySpawnInterval { get; }

Property Value

float

SelfPropelled

Whether or not the particle is self-propelled.

public virtual bool SelfPropelled { get; }

Property Value

bool

Size

gets the size of the particle.

public virtual float Size { get; }

Property Value

float

SizeEvolve

gets the dynamic size of the particle.

public virtual EvolvingNatFloat SizeEvolve { get; }

Property Value

EvolvingNatFloat

SwimOnLiquid

public virtual bool SwimOnLiquid { get; }

Property Value

bool

TerrainCollision

Whether or not the particle collides with the terrain or not.

public bool TerrainCollision { get; }

Property Value

bool

VelocityEvolve

Get the dynamic speeds of the particle.

public virtual EvolvingNatFloat[] VelocityEvolve { get; }

Property Value

EvolvingNatFloat[]

VertexFlags

gets the glow level of the particle.

public virtual int VertexFlags { get; }

Property Value

int

WindAffected

public bool WindAffected { get; set; }

Property Value

bool

Methods

BeginParticle()

Called just before a new particle is being created. You can use this to produce e.g. alternating kinds of particles

public virtual void BeginParticle()

FromBytes(BinaryReader, IWorldAccessor)

How the particle is read from the save.

public virtual void FromBytes(BinaryReader reader, IWorldAccessor resolver)

Parameters

reader BinaryReader
resolver IWorldAccessor

GetRgbaColor(ICoreClientAPI)

Gets the color of the particle.

public virtual int GetRgbaColor(ICoreClientAPI capi)

Parameters

capi ICoreClientAPI

Returns

int

GetVelocity(Vec3d)

Gets the velocity of the particles.

public virtual Vec3f GetVelocity(Vec3d pos)

Parameters

pos Vec3d

Returns

Vec3f

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 ParticleBase

The parent IParticleInstance from which this secondary particle is being spawned

ToBytes(BinaryWriter)

How the particle is written to the save. (if it is)

public virtual void ToBytes(BinaryWriter writer)

Parameters

writer BinaryWriter