1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

ReflectionProbe add Blend Distance

This commit is contained in:
landervr
2024-12-03 12:08:36 +01:00
parent eb5103093c
commit 05010180ce
18 changed files with 128 additions and 10 deletions

View File

@@ -165,6 +165,32 @@ void ReflectionProbeGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
aabb.position = -size / 2;
aabb.size = size;
AABB blend_aabb;
for (int i = 0; i < 3; i++) {
blend_aabb.position[i] = aabb.position[i] + probe->get_blend_distance();
blend_aabb.size[i] = aabb.size[i] - probe->get_blend_distance() * 2.0;
if (blend_aabb.size[i] < blend_aabb.position[i]) {
blend_aabb.position[i] = aabb.position[i] + aabb.size[i] / 2.0;
blend_aabb.size[i] = 0.0;
}
}
if (probe->get_blend_distance() != 0.0) {
for (int i = 0; i < 12; i++) {
Vector3 a;
Vector3 b;
blend_aabb.get_edge(i, a, b);
lines.push_back(a);
lines.push_back(b);
}
for (int i = 0; i < 8; i++) {
Vector3 ep = aabb.get_endpoint(i);
internal_lines.push_back(blend_aabb.get_endpoint(i));
internal_lines.push_back(ep);
}
}
Vector<Vector3> handles = helper->box_get_handles(probe->get_size());
if (probe->get_origin_offset() != Vector3(0.0, 0.0, 0.0)) {