Godot Polygon 2D Fracture

This tool provides simple scripts for fracturing and cutting 2D polygons in Godot. It supports Delaunay and cut-line fracturing methods, polygon restoring, and includes helper functions for polygon manipulation.

https://github.com/SoloByte/godot-polygon2d-fracture

Preview Images

Preview
Preview
Preview
Preview

Godot Polygon 2D Fracture: A Comprehensive Tool for Dynamic 2D Destruction

This Godot Engine tool offers a straightforward solution for implementing 2D polygon fracturing and cutting within your games. It provides two primary scripts: PolygonFracture.gd for the core fracturing/cutting logic and PolygonLib.gd, which enhances functionality with helper functions for polygon manipulation. Supporting both Godot 3 and Godot 4 (versions 4.2+), it is a versatile resource for developers seeking to add dynamic destruction or creative effects to their projects.

Key Features

  • Fracturing Methods: Includes Delaunay triangulation for triangle fractures and cut-line-based fracturing for polygon fractures.
  • Cutting System: Employs a polygon-based cut method, using one polygon as the source and another as the cutting shape.
  • Polygon Restoring: Offers simple and advanced methods for restoring fractured polygons to their original state.
  • Helper Functions: PolygonLib.gd provides functions for area calculation, triangulation, random point generation within polygons, bounding rectangle calculation, and creating circle polygons.
  • Texture Support: Polygons with textures can be cut and fractured.

Use Cases

Ideal for games requiring destructible environments, dynamic visual effects, or creative gameplay mechanics involving polygon manipulation. The tool's GDScript implementation makes it easily accessible and modifiable for various project needs. Consider exploring the included demo project to understand the practical applications of this tool. The author uses it in their game Fracture Hell.

Resource Details

tool

SoloByte



4.2, 4.2.2, 3.2