PenaltyCollision

Collision is a NearBehavior that calculates collision interactions between a particle and its nearby particles using softer penalty forces. Collisions are basically spring constraints between particles when they collide. High stiffness values can lead to energy inconsistency, whereas lower stiffness can cause poor colliding behavior between particles. Overall, this method is more stable in high density stacking simulations, but performs worse in more dynamic scenarios.

Constructor

new PenaltyCollision()

Instantiates new PenaltyCollision behavior object

Extends

Methods

applyBehavior(particle, particles, timeStep)

Perform the collision update of a Particle by calculating impulse based velocity and position changes.

Parameters:
NameTypeDescription
particleParticle

particle with collision check

particlesArray.<Particle>

nearby particles that interact with particle

timeStepNumber

applyCorrection(particle, particles)

This class does not require final position corrections

Parameters:
NameTypeDescription
particleParticle

particle with collision check

particlesArray.<Particle>

nearby particles that interact with particle

range() → {null}

Returns the effective range / defines the size of the nearby range

Returns:
Type: 
null

(static) isCollide(p1, p2)

A static method that checks whether two particles are colliding

Parameters:
NameTypeDescription
p1Particle
p2Particle
Returns:

boolean