Constructor
new Collision()
Instantiates new Collision behavior object
- Source
Extends
Methods
applyBehavior(particle, particles, timeStep)
Perform the collision update of a Particle
by calculating impulse based velocity and position changes.
Name | Type | Description |
---|---|---|
particle | Particle | particle with collision check |
particles | Array.<Particle> | nearby particles that interact with |
timeStep | Number |
- Overrides
- Source
applyCorrection(particle, particles)
Performs the position-based correction after impulse collision. This ensures that particles are not stuck within each other.
Name | Type | Description |
---|---|---|
particle | Particle | particle with collision check |
particles | Array.<Particle> | nearby particles that interact with |
- Overrides
- Source
range() → {null}
Returns the effective range / defines the size of the nearby range
- Overrides
- Source
- Type:
- null
(static) isCollide(p1, p2)
A static method that checks whether two particles are colliding
- Source
boolean