[Unity plugin] Basic support for heightfields #1253
Merged
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.
This PR adds preliminary support for heightfields in the Unity plugin. The hfield type is now allowed to be selected in MjGeom, and lets you reference a Unity terrain object. Heightmaps can be loaded and configured with the built-in Unity tools in the paired terrain component. When the scene MJCF is constructed, the current heightmap of the terrain will be saved as a PNG at a path local to the Application as specified by the user, which will be referenced in the scene's assets.
The current implementation does not support importing heightfields referenced from an MJCF, nor does it support runtime terrain editing, but both are straightforward future additions.
Let me know if you think it would be better to wait until those features are implemented.
Movie_005.mp4