Constructor
new WallBoundary(x1, y1, x2, y2, width)
Instantiates new WallBoundary
Name | Type | Default | Description |
---|---|---|---|
x1 | * | x-position of first vertex | |
y1 | * | y-position of first vertex | |
x2 | * | x-position of second vertex | |
y2 | * | y-position of second vertex | |
width | * | 1 | rendered line width of wall (does not effect physics) |
- Source
Extends
Methods
applyCorrection(particles)
Applies positional corrections on particles (walls do not move)
Name | Type | Description |
---|---|---|
particles | Array.<Particle> |
- Overrides
- Source
getHashDimensions() → {Array.<Number>}
Computes the dimensions of the item for the HashGrid
.
- Overrides
- Source
- Type:
- Array.<Number>
getHashPos() → {Array.<Number>}
Computes the coordinate position for the item within the HashGrid
, expects center position.
- Overrides
- Source
- Type:
- Array.<Number>
isCollide(particle) → {Boolean}
Checks if a Particle is colliding with the Wall
Name | Type | Description |
---|---|---|
particle | Particle |
- Source
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
- Source
vertices() → {Array.<Vector2D>}
Calculates the vertices of the wall
- Overrides
- Source
- Type:
- Array.<Vector2D>