PolygonShape constructor

PolygonShape(
  1. List<Vector2> relativePoints, {
  2. Vector2? position,
})

Implementation

PolygonShape(this.relativePoints, {Vector2? position})
    : assert(relativePoints.length > 2),
      points = _initPoints(relativePoints, position ?? Vector2.zero()),
      rect = _initRect(relativePoints, position ?? Vector2.zero()),
      super(position ?? Vector2.zero()) {
  _minX = rect.position.x - (position?.x ?? 0);
  _minY = rect.position.y - (position?.y ?? 0);
}