Skip to content

Add sampler functions to HeightMapShape3D#116922

Open
Quantx wants to merge 1 commit intogodotengine:masterfrom
Quantx:heightmap_samplers
Open

Add sampler functions to HeightMapShape3D#116922
Quantx wants to merge 1 commit intogodotengine:masterfrom
Quantx:heightmap_samplers

Conversation

@Quantx
Copy link

@Quantx Quantx commented Mar 1, 2026

Closes godotengine/godot-proposals#14363 by implementing sampler functions for HeightMapShape3D that return the height at a given position without invoking PhysicsServer3D. This has been tested extensively and accurately mirrors how the physics engine (both Jolt and GodotPhysics3D) compute heightmap collisions, including NaN holes.

This project heightmap-test.zip provides a basic test environment to validate my changes. Ensure that you open it using this PR's build and that Debug > Visible Collision Shapes is enabled. A random heightmap of size 25x25 with a NaN hole in the middle will be generated each time the project is run. The camera can be moved with WASD and rotated by holding right click while dragging the mouse. A green sphere is drawn based on a raycast emitted from the center of the camera. While a blue sphere is drawn based on the sampled heightmap height at the same position. The margin between Y position of the two spheres is displayed in the top left (closer to zero is better).

@Quantx Quantx requested a review from a team as a code owner March 1, 2026 10:46
@Nintorch Nintorch added this to the 4.x milestone Mar 1, 2026
@Quantx Quantx force-pushed the heightmap_samplers branch from 51d9521 to a1772b2 Compare March 1, 2026 22:44
@Quantx Quantx requested a review from a team as a code owner March 1, 2026 22:44
@Quantx Quantx force-pushed the heightmap_samplers branch from a1772b2 to b6cd041 Compare March 1, 2026 22:46
@AThousandShips AThousandShips changed the title Added sampler functions to HeightMapShape3D Add sampler functions to HeightMapShape3D Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add sampler functions for HeightMapShape3D

3 participants