-
-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modifiers: support nesting #698
base: master
Are you sure you want to change the base?
Conversation
Slightly reformat the NOTIFICATION_LOCAL_TRANSFORM_CHANGED handler inside voxel_modifier_gd. This will allow for my next commit to be slightly cleaner. Signed-off-by: NTOP <[email protected]>
Ignore transform update notifications that do not actually alter the modifier's position in terrain-local space. Support modifiers as indirect children. Switch to ENTER/EXIT_TREE notifications to detect when intermediate ancestors are added or removed from the terrain node. Switch to NOTIFICATION_TRANSFORM_CHANGED to detect when intermediate ancestor transforms change. Signed-off-by: NTOP <[email protected]>
Multiply modifier bounds transforms by the terrain parent_transform so that modifier are correctly rendered when the voxel terrain has non-identity transform. Signed-off-by: NTOP <[email protected]>
One thing I notice off the bat is that I did not implement this in my version: void VoxelModifier::mark_as_immediate_child(bool v) {
} break;
_is_immediate_child = v;
if (_is_immediate_child) {
set_notify_local_transform(true);
set_notify_transform(false);
} else {
set_notify_local_transform(false);
set_notify_transform(true);
}
} I considered doing something essentially identical, but I decided that the performance gains (which if I am not mistaken aren't much?) were not worth cluttering the solution. Please let me know if you disagree with that judgement, though! |
That also appears to be the only substantive difference between our two PRs, other than a totally different approach to event handling |
I'm still not happy with the workarounds that Godot requires to make this work, it always makes it more expensive too. Just like the other PR, I'm not sure about merging this. |
8fdf450
to
a393969
Compare
This PR improves/adds support for nested modifier structures in the voxel lod terrain tree.
These changes are not of particular importance to me (other than the ability to filter out terrain translation). I just happened to be in the area and noticed your TODO comment, and I thought this might be a good place to cut my teeth.