Repository navigation
Reuse thick branch and trunk shell shapes - #1231
Open
BonsUnleashed wants to merge 1 commit into
Open
BonsUnleashed wants to merge 1 commit into
BonsUnleashed wants to merge 1 commit into
Conversation
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.
Thick branch collision shapes are determined by radius, but the same boxes are rebuilt each time the shape is requested. Trunk shells then build another box translated from that shape.
This creates the sixteen thick-branch shapes once and reuses them for radii 9 through 24. Shells reuse precomputed translated boxes when their muse returns one of those exact shapes and the offset is within the supported horizontal range. Custom muse shapes, larger offsets and unusual radii still use the original calculation. Muse lookup and its update scheduling run on every request as before.
The corresponding optimization is included in the upcoming Bons and Furious 1.0.30. This direct version shares immutable shapes across branch instances and never caches a world, position or mutable block lookup result.
compileJavapassed against the currentrelease/1.20.1branch on Java 17.Source-extracted shape methods passed checks for radii 1 through 32 and 3,528 offsets, including custom-shape, vertical and out-of-range fallbacks. Those checks use geometry stubs; I have not run an in-game collision or tree-generation check of this PR build.