-
Notifications
You must be signed in to change notification settings - Fork 137
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
Fix update_transforms issues #585
Conversation
04f211e
to
a0941d4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per my comments, I think line 805 in data.cpp is the main culprit.
the smaller AABB is actually usuable for much more constrained updates too, at line 833~ modify to: for (int i = 0; i < xforms.size(); i++) {
Transform3D t = xforms[i];
if (brush_rect.has_point(Point2(t.origin.x + global_local_offset.x, t.origin.z + global_local_offset.z))) {
Vector3 height_offset = t.basis.get_column(1) * mesh_height_offset;
t.origin -= height_offset;
real_t height = _terrain->get_data()->get_height(t.origin + global_local_offset);
// If the new height is a nan due to creating a hole, remove the instance
if (std::isnan(height)) {
continue;
}
t.origin.y = height;
t.origin += height_offset;
updated_xforms.push_back(t);
updated_colors.push_back(colors[i]);
} else {
updated_xforms.push_back(t);
updated_colors.push_back(colors[i]);
}
} which prevents modifying the entire cell at once (tho the whole cell will still be itterated over) |
Those changes are in. So far this PR addresses:
Outstanding:
|
could increase the triple to a quadruple and store the (tool height) offset as a PackedFloat32Array perhaps. and/or; Very out of scope for this PR, I think an extra foliage transform tool might be a better way to go, a brush with expand/shrink (to modify scale of existing xforms) and raise / lower. A foliage color tool could be nice as well. |
8cbc241
to
3dc432c
Compare
3dc432c
to
ccd086e
Compare
Some how I dropped the limit update to brush size rather than whole cell. Fortunately I found it in my reflog. Added in 5ab6742 |
Fixes #584
Fixes #544
Issues addressed:
Not done: