Constructor
new RectangularWorldBoundary(minW, maxW, minH, maxH)
Name | Type | Description |
---|---|---|
minW | Number | left x position (smaller value) |
maxW | Number | right x position (larger value) |
minH | Number | top y position (smaller value) |
maxH | Number | bottom y position (larger value) |
Extends
Methods
applyCorrection(particles)
Applies positional corrections on particles (walls do not move)
Name | Type | Description |
---|---|---|
particles | Array.<Particle> |
- Overrides
getHashDimensions() → {Array.<Number>}
Computes the dimensions of the item for the HashGrid
.
- Overrides
- Type:
- Array.<Number>
getHashPos() → {Array.<Number>}
Computes the coordinate position for the item within the HashGrid
, expects center position.
- Overrides
- Type:
- Array.<Number>
isCollide(particle) → {Boolean}
Checks if a Particle is colliding with the Wall
Name | Type | Description |
---|---|---|
particle | Particle |
true if particle is colliding with wall
- Type:
- Boolean
resolveCollisions(particles, timeStep)
Resolve the collisions between the surrounding particles and the Wall itself.
Name | Type | Description |
---|---|---|
particles | Array.<Particle> | |
timeStep | Number |
- Overrides
vertices() → {Array.<Vector2D>}
Calculates the vertices of the wall
- Overrides
- Type:
- Array.<Vector2D>