Add sampler functions to HeightMapShape3D#116922
Open
Quantx wants to merge 1 commit intogodotengine:masterfrom
Open
Add sampler functions to HeightMapShape3D#116922Quantx wants to merge 1 commit intogodotengine:masterfrom
HeightMapShape3D#116922Quantx wants to merge 1 commit intogodotengine:masterfrom
Conversation
51d9521 to
a1772b2
Compare
a1772b2 to
b6cd041
Compare
HeightMapShape3D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes godotengine/godot-proposals#14363 by implementing sampler functions for
HeightMapShape3Dthat return the height at a given position without invokingPhysicsServer3D. 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 Shapesis 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).