Edit of asset "Shape SDF" Accepted

Old/Current New/Edit
Title Shape SDF Shape SDF
Description Shape SDF answers "how far is this point from that collision shape?" It returns the signed distance (negative inside), the closest point on the surface and the outward surface normal, for Godot's own physics shapes in 2D and 3D.

Use it for gravity or magnet forces around capsule, box or torus shaped planets, to find the nearest surface to snap or teleport to, to measure how deep something is inside an area, for time to impact, or for ray marching against colliders.

It is plain GDScript with static functions in ShapeSDF3D and ShapeSDF2D, so there is nothing to enable. Query a shape with a transform, a CollisionShape node, or every shape of a body or area at once. Supported: Sphere, Box, Capsule, Cylinder and WorldBoundary shapes and tori in 3D; Circle, Rectangle, Capsule, ConvexPolygon, Segment and WorldBoundary shapes in 2D. ConvexPolygonShape3D, concave and heightmap shapes are not supported yet.

This add-on implements godot-proposals#5218. The distance formulas follow Inigo Quilez's distance functions. It was tested in Godot 4.2.2, 4.6.3 and 4.7.2 (also with Jolt in 4.6.3 and 4.7.2), including checks against the physics engine's own queries. Documentation, known limitations, demos and a Korean version are in the repository.
Shape SDF answers "how far is this point from that collision shape?" It returns the signed distance (negative inside), the closest point on the surface and the outward surface normal, for Godot's own physics shapes in 2D and 3D.

Use it for gravity or magnet forces around capsule, box or torus shaped planets, to find the nearest surface to snap or teleport to, to measure how deep something is inside an area, for time to impact, or for ray marching against colliders.

It is plain GDScript with static functions in ShapeSDF3D and ShapeSDF2D, so there is nothing to enable. Query a shape with a transform, a CollisionShape node, or every shape of a body or area at once. Supported: Sphere, Box, Capsule, Cylinder and WorldBoundary shapes and tori in 3D; Circle, Rectangle, Capsule, ConvexPolygon, Segment and WorldBoundary shapes in 2D. ConvexPolygonShape3D, concave and heightmap shapes are not supported yet.

This add-on implements godot-proposals#5218. The distance formulas follow Inigo Quilez's distance functions. It was tested in Godot 4.2.2, 4.6.3 and 4.7.2 (also with Jolt in 4.6.3 and 4.7.2), including checks against the physics engine's own queries. Documentation, known limitations, demos and a Korean version are in the repository.
Category Scripts Scripts
License MIT MIT
Repository Provider GitHub GitHub
Repository Url https://github.com/heekwankim0401-collab/godot-shape-sdf https://github.com/heekwankim0401-collab/godot-shape-sdf
Issues Url https://github.com/heekwankim0401-collab/godot-shape-sdf/issues https://github.com/heekwankim0401-collab/godot-shape-sdf/issues
Godot version Godot 4.2 Godot 4.2
Version String 1.0.0 1.0.0
Download Commit 675bd25c3e4b6cd795c95071516fe490ff33fbe2 675bd25c3e4b6cd795c95071516fe490ff33fbe2
Download Url (Computed) https://github.com/heekwankim0401-collab/godot-shape-sdf/archive/675bd25c3e4b6cd795c95071516fe490ff33fbe2.zip https://github.com/heekwankim0401-collab/godot-shape-sdf/archive/675bd25c3e4b6cd795c95071516fe490ff33fbe2.zip
Icon Url https://raw.githubusercontent.com/heekwankim0401-collab/godot-shape-sdf/main/media/icon.png
https://raw.githubusercontent.com/heekwankim0401-collab/godot-shape-sdf/main/media/icon.png
Preview Insert
Type image
Image/Video URL https://raw.githubusercontent.com/heekwankim0401-collab/godot-shape-sdf/main/media/thumbnail.png
Thumbnail https://raw.githubusercontent.com/heekwankim0401-collab/godot-shape-sdf/main/media/thumbnail.png
Preview Insert
Type image
Image/Video URL https://raw.githubusercontent.com/heekwankim0401-collab/godot-shape-sdf/main/media/screenshot_3d.png
Thumbnail https://raw.githubusercontent.com/heekwankim0401-collab/godot-shape-sdf/main/media/screenshot_3d.png