ParticleSystem class


ParticleSystem(World world, {double pressureStrength = 0.05, double dampingStrength = 1.0, double elasticStrength = 0.25, double springStrength = 0.25, double viscousStrength = 0.25, double surfaceTensionStrengthA = 0.1, double surfaceTensionStrengthB = 0.2, double powderStrength = 0.5, double ejectionStrength = 0.5, double colorMixingStrength = 0.5})


allGroupFlags int
getter/setter pair
allParticleFlags int
getter/setter pair
bodyContactBuffer List<ParticleBodyContact>
colorMixingStrength double
getter/setter pair
contactBuffer List<ParticleContact>
dampingStrength double
getter/setter pair
ejectionStrength double
getter/setter pair
elasticStrength double
getter/setter pair
gravityScale double
getter/setter pair
groupBuffer Set<ParticleGroup>
hashCode int
The hash code for this object.
no setterinherited
inverseDensity double
no setter
inverseDiameter double
getter/setter pair
pairBuffer List<PsPair>
particleCount int
no setter
particleDensity double
getter/setter pair
particleDiameter double
getter/setter pair
particleGroupCount int
no setter
particleInverseMass double
no setter
particleMass double
no setter
particleRadius double
getter/setter pair
particles UnmodifiableListView<Particle>
no setter
particleStride double
no setter
powderStrength double
getter/setter pair
pressureStrength double
getter/setter pair
proxyBuffer List<PsProxy>
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
springStrength double
getter/setter pair
squaredDiameter double
getter/setter pair
surfaceTensionStrengthA double
getter/setter pair
surfaceTensionStrengthB double
getter/setter pair
timestamp int
getter/setter pair
triadBuffer List<PsTriad>
viscousStrength double
getter/setter pair
world World


addContact(Particle particleA, Particle particleB) → void
computeDepthForGroup(ParticleGroup group) → void
computeParticleCollisionEnergy() double
createParticle(Particle particle) → void
createParticleGroup(ParticleGroupDef groupDef) ParticleGroup
destroyParticle(Particle particle, {required bool callDestructionListener}) → void
destroyParticlesInGroup(ParticleGroup group, {bool callDestructionListener = false}) → void
destroyParticlesInShape(Shape shape, Transform xf, {bool callDestructionListener = false}) → void
Destroy particles inside a shape. In addition, this function immediately destroys particles in the shape in contrast to DestroyParticle() which defers the destruction until the next simulation step.
getCriticalPressure(TimeStep step) double
getCriticalVelocity(TimeStep step) double
getCriticalVelocitySquared(TimeStep step) double
joinParticleGroups(ParticleGroup groupA, ParticleGroup groupB) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
queryAABB(ParticleQueryCallback callback, AABB aabb) → void
raycast(ParticleRaycastCallback callback, Vector2 point1, Vector2 point2) → void
render(DebugDraw debugDraw) → void
solve(TimeStep step) → void
solveCollision(TimeStep step) → void
solveColorMixing(TimeStep step) → void
solveDamping(TimeStep step) → void
solveElastic(TimeStep step) → void
solvePowder(TimeStep step) → void
solvePressure(TimeStep step) → void
solveRigid(TimeStep step) → void
solveSolid(TimeStep step) → void
solveSpring(TimeStep step) → void
solveTensile(TimeStep step) → void
solveViscous(TimeStep step) → void
solveWall(TimeStep step) → void
solveZombie() → void
toString() String
A string representation of this object.
updateBodyContacts() → void
updateContacts({bool excludeZombies = true}) → void


operator ==(Object other) bool
The equality operator.

Static Methods

computeRelativeTag(int tag, int x, int y) int
computeTag(double x, double y) int
lowerBound(Iterable<PsProxy> ray, int tag) int
upperBound(Iterable<PsProxy> ray, int tag) int


noPressureFlags → const int
All particle types that require computing depth
pairFlags → const int
All particle types that require creating pairs
tagBits → const int
triadFlags → const int
All particle types that require creating triads
xMask → const int
xOffset → const int
xScale → const int
xShift → const int
xTruncBits → const int
yMask → const int
yOffset → const int
yShift → const int
yTruncBits → const int