PathHitbox constructor

PathHitbox({
  1. required Path path,
  2. double sampling = 1.0,
  3. double? tolerance,
  4. bool filter = true,
  5. Vector2? position,
  6. double? angle,
  7. Anchor? anchor,
  8. bool isSolid = false,
  9. CollisionType collisionType = CollisionType.active,
})

With this constructor you create a PathHitbox from all the closed contours of the path.

See PathComponent.new for the sampling, tolerance and filter parameters. Fewer vertices make the collision detection cheaper, so use the highest sampling that still follows the path closely enough.

Implementation

PathHitbox({
  required super.path,
  super.sampling,
  super.tolerance,
  super.filter,
  super.position,
  super.angle,
  super.anchor,
  super.isSolid,
  CollisionType collisionType = CollisionType.active,
}) {
  this.collisionType = collisionType;
}