Wall

Wall is an Interface for any wall objects. Walls are HashGridItems; however, it only uses the SpatialHashGrid methods that calculate the particles in its close proximity and cannot be added to the grid itself. Wall objects are also stationary and are not influenced by any external factors.

Instantiates new Wall

Extends

Methods

(abstract) applyCorrection(particles)

Applies positional corrections on particles (walls do not move)

Parameters:
NameTypeDescription
particlesArray.<Particle>

(abstract) getHashDimensions() → {Array.<Number>}

Computes the dimensions of the item for the HashGrid.

Returns:

rectangular dimensions in [width, height]

Type: 
Array.<Number>

(abstract) getHashPos() → {Array.<Number>}

Computes the coordinate position for the item within the HashGrid, expects center position.

Returns:
Type: 
Array.<Number>

(abstract) resolveCollisions(particles, timeStep)

Resolve the collisions between the surrounding particles and the Wall itself.

Parameters:
NameTypeDescription
particlesArray.<Particle>

surrounding particles that interact with the wall

timeStepNumber

(abstract) vertices() → {Array.<Vector2D>}

Calculates the vertices of the wall

Returns:
Type: 
Array.<Vector2D>