Table of Contents

Class AirBubbleParticles

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll
public class AirBubbleParticles : IParticlePropertiesProvider
Inheritance
AirBubbleParticles
Implements
Inherited Members

Fields

AddVelocity

The velocity to add to the bubble particle.

public Vec3f AddVelocity

Field Value

Vec3f

BasePos

The base position of the bubble particle.

public Vec3d BasePos

Field Value

Vec3d

Range

public float Range

Field Value

float

horVelocityMul

public float horVelocityMul

Field Value

float

quantity

public float quantity

Field Value

float

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

Return null or 1 if opacity should remain unchanged over time. lifetimeLeft is always a value between 0 and 1

public EvolvingNatFloat BlueEvolve { get; }

Property Value

EvolvingNatFloat

Bounciness

public float Bounciness { get; set; }

Property Value

float

DeathParticles

Gets the death particles.

public IParticlePropertiesProvider[] DeathParticles { get; }

Property Value

IParticlePropertiesProvider[]

There are no death particles for bubbles.

DieInAir

Whether or not the bubbles die in air.

public bool DieInAir { get; }

Property Value

bool

Yes they die in air.

DieInLiquid

Whether or not the bubbles die in liquid.

public bool DieInLiquid { get; }

Property Value

bool

They don't.

DieOnRainHeightmap

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

public bool DieOnRainHeightmap { get; }

Property Value

bool

GravityEffect

Gets the gravity applied to the particle.

public float GravityEffect { get; }

Property Value

float

None.

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; }

Property Value

EvolvingNatFloat

LifeLength

Gets the length of life for the particle.

public float LifeLength { get; set; }

Property Value

float

0.25f

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; }

Property Value

EvolvingNatFloat

ParentVelocity

public Vec3f ParentVelocity { get; }

Property Value

Vec3f

ParticleModel

The base model of the particle.

public EnumParticleModel ParticleModel { get; }

Property Value

EnumParticleModel

It's a cube.

Pos

Position in the world where the particle should spawn

public Vec3d Pos { get; }

Property Value

Vec3d

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

float

RandomVelocityChange

public bool RandomVelocityChange { get; set; }

Property Value

bool

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; }

Property Value

EvolvingNatFloat

SecondaryParticles

Gets the secondary particles

public IParticlePropertiesProvider[] SecondaryParticles { get; }

Property Value

IParticlePropertiesProvider[]

null, the bubble particles don't have secondary particles.

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

float

SelfPropelled

This particle is not self propelled.

public bool SelfPropelled { get; }

Property Value

bool

Size

Size of the particle

public float Size { get; }

Property Value

float

SizeEvolve

Size change over time

public EvolvingNatFloat SizeEvolve { get; }

Property Value

EvolvingNatFloat

SwimOnLiquid

Whether or not the bubbles die in liquid.

public bool SwimOnLiquid { get; set; }

Property Value

bool

They don't.

TerrainCollision

Whether or not the bubble collides with the terrain.

public bool TerrainCollision { get; }

Property Value

bool

VelocityEvolve

Velocity change over time (acts as a multiplier to the velocity)

public EvolvingNatFloat[] VelocityEvolve { get; }

Property Value

EvolvingNatFloat[]

VertexFlags

Gets the glow level of the bubbles.

public int VertexFlags { get; }

Property Value

int

No glow.

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()

FromBytes(BinaryReader, IWorldAccessor)

This particle does not load from file.

public void FromBytes(BinaryReader reader, IWorldAccessor resolver)

Parameters

reader BinaryReader
resolver IWorldAccessor

GetRgbaColor(ICoreClientAPI)

The particles Rgba Color

public int GetRgbaColor(ICoreClientAPI capi)

Parameters

capi ICoreClientAPI

Returns

int

GetVelocity(Vec3d)

In what direction should the particle fly/fall

public Vec3f GetVelocity(Vec3d pos)

Parameters

pos Vec3d

Returns

Vec3f

Init(ICoreAPI)

Initializes the bubble particle.

public void Init(ICoreAPI api)

Parameters

api ICoreAPI

The core API.

PrepareForSecondarySpawn(ParticleBase)

Updates instance related state for secondary particles based on the given parent particle instance

public void PrepareForSecondarySpawn(ParticleBase particleInstance)

Parameters

particleInstance ParticleBase

The parent IParticleInstance from which this secondary particle is being spawned

ToBytes(BinaryWriter)

This particle does not save to file.

public void ToBytes(BinaryWriter writer)

Parameters

writer BinaryWriter