class ParticleCollisions

Inherits: ParticleEvolver

Particle evolver that allows particles to collide with the world.

Public

Constructors

ParticleCollisions

ParticleCollisions() = default

ParticleCollisions

ParticleCollisions(const ParticleCollisionSettings &settings)

Methods

SetPlanes

void SetPlanes(Vector<Plane> planes)

Determines a set of planes to use when using the Plane collision mode.

Planes are expected to be in world space.

GetPlanes

const Vector<Plane> &GetPlanes() const

SetPlaneObjects

void SetPlaneObjects(Vector<HSceneObject> objects)

Determines a set of objects whose transforms to derive the collision planes from.

Objects can move in the world and collision planes will be updated automatically. Object's negative Z axis is considered to be plane normal.

GetPlaneObjects

const Vector<HSceneObject> &GetPlaneObjects() const

SetSettings

void SetSettings(const ParticleCollisionSettings &settings)

Options describing the evolver.

GetSettings

const ParticleCollisionSettings &GetSettings() const

GetProperties

const ParticleEvolverProperties &GetProperties() const override

Returns a set of properties that describe this evolver type.

staticCreate

static SPtr<ParticleCollisions> Create(const ParticleCollisionSettings &settings)

Creates a new particle collision evolver.

staticCreate

static SPtr<ParticleCollisions> Create()

Creates a new particle collision evolver.

staticGetRttiStatic

static RTTIType *GetRttiStatic()

GetRtti

RTTIType *GetRtti() const override

Returns an interface you can use to access class' Run Time Type Information.

Private

Methods

Evolve

void Evolve(Random &random, const ParticleSystemState &state, ParticleSet &set, u32 startIdx, u32 count, bool spacing, float spacingOffset) const override

Updates properties of particles in the provided range according to the ruleset of the evolver.

random
Utility class for generating random numbers.
state
Particle system state for this frame.
set
Set containing the particles to update.
startIdx
Index of the first particle in to update.
count
Number of particles to update, starting from .
spacing
When false all particles will use the same time-step as provided by . If true the time-step will be divided by so particles are uniformly distributed over the time-step.
spacingOffset
Extra offset that controls the starting position of the first particle when calculating spacing. Should be in range [0, 1). 0 = beginning of the current time step, 1 = start of next particle.

Fields

mSettings

mCollisionPlanes

Vector<Plane> mCollisionPlanes

mCollisionPlaneObjects

Vector<HSceneObject> mCollisionPlaneObjects