summaryrefslogtreecommitdiff
path: root/editor/spatial_editor_gizmos.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/spatial_editor_gizmos.cpp')
-rw-r--r--editor/spatial_editor_gizmos.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp
index 3f8d93d976..3ffc61cb45 100644
--- a/editor/spatial_editor_gizmos.cpp
+++ b/editor/spatial_editor_gizmos.cpp
@@ -149,7 +149,7 @@ void EditorSpatialGizmo::add_lines(const Vector<Vector3> &p_lines, const Ref<Mat
md = MAX(0, p_lines[i].length());
}
if (md) {
- mesh->set_custom_aabb(Rect3(Vector3(-md, -md, -md), Vector3(md, md, md) * 2.0));
+ mesh->set_custom_aabb(AABB(Vector3(-md, -md, -md), Vector3(md, md, md) * 2.0));
}
}
@@ -196,7 +196,7 @@ void EditorSpatialGizmo::add_unscaled_billboard(const Ref<Material> &p_material,
md = MAX(0, vs[i].length());
}
if (md) {
- mesh->set_custom_aabb(Rect3(Vector3(-md, -md, -md), Vector3(md, md, md) * 2.0));
+ mesh->set_custom_aabb(AABB(Vector3(-md, -md, -md), Vector3(md, md, md) * 2.0));
}
}
@@ -211,7 +211,7 @@ void EditorSpatialGizmo::add_unscaled_billboard(const Ref<Material> &p_material,
instances.push_back(ins);
}
-void EditorSpatialGizmo::add_collision_triangles(const Ref<TriangleMesh> &p_tmesh, const Rect3 &p_bounds) {
+void EditorSpatialGizmo::add_collision_triangles(const Ref<TriangleMesh> &p_tmesh, const AABB &p_bounds) {
collision_mesh = p_tmesh;
collision_mesh_bounds = p_bounds;
@@ -270,7 +270,7 @@ void EditorSpatialGizmo::add_handles(const Vector<Vector3> &p_handles, bool p_bi
md = MAX(0, p_handles[i].length());
}
if (md) {
- mesh->set_custom_aabb(Rect3(Vector3(-md, -md, -md), Vector3(md, md, md) * 2.0));
+ mesh->set_custom_aabb(AABB(Vector3(-md, -md, -md), Vector3(md, md, md) * 2.0));
}
}
@@ -1274,7 +1274,7 @@ void MeshInstanceSpatialGizmo::redraw() {
Ref<TriangleMesh> tm = m->generate_triangle_mesh();
if (tm.is_valid()) {
- Rect3 aabb;
+ AABB aabb;
add_collision_triangles(tm, aabb);
}
}
@@ -1336,7 +1336,7 @@ void SkeletonSpatialGizmo::redraw() {
weights[0] = 1;
- Rect3 aabb;
+ AABB aabb;
Color bonecolor = Color(1.0, 0.4, 0.4, 0.3);
Color rootcolor = Color(0.4, 1.0, 0.4, 0.1);
@@ -1961,7 +1961,7 @@ void CollisionShapeSpatialGizmo::redraw() {
Ref<BoxShape> bs = s;
Vector<Vector3> lines;
- Rect3 aabb;
+ AABB aabb;
aabb.position = -bs->get_extents();
aabb.size = aabb.position * -2;
@@ -2191,7 +2191,7 @@ void VisibilityNotifierGizmo::set_handle(int p_idx, Camera *p_camera, const Poin
//gt.orthonormalize();
Transform gi = gt.affine_inverse();
- Rect3 aabb = notifier->get_aabb();
+ AABB aabb = notifier->get_aabb();
Vector3 ray_from = p_camera->project_ray_origin(p_point);
Vector3 ray_dir = p_camera->project_ray_normal(p_point);
@@ -2234,7 +2234,7 @@ void VisibilityNotifierGizmo::redraw() {
clear();
Vector<Vector3> lines;
- Rect3 aabb = notifier->get_aabb();
+ AABB aabb = notifier->get_aabb();
for (int i = 0; i < 12; i++) {
Vector3 a, b;
@@ -2293,7 +2293,7 @@ void ParticlesGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_poi
bool move = p_idx >= 3;
p_idx = p_idx % 3;
- Rect3 aabb = particles->get_visibility_aabb();
+ AABB aabb = particles->get_visibility_aabb();
Vector3 ray_from = p_camera->project_ray_origin(p_point);
Vector3 ray_dir = p_camera->project_ray_normal(p_point);
@@ -2347,7 +2347,7 @@ void ParticlesGizmo::redraw() {
clear();
Vector<Vector3> lines;
- Rect3 aabb = particles->get_visibility_aabb();
+ AABB aabb = particles->get_visibility_aabb();
for (int i = 0; i < 12; i++) {
Vector3 a, b;
@@ -2420,7 +2420,7 @@ String ReflectionProbeGizmo::get_handle_name(int p_idx) const {
}
Variant ReflectionProbeGizmo::get_handle_value(int p_idx) const {
- return Rect3(probe->get_extents(), probe->get_origin_offset());
+ return AABB(probe->get_extents(), probe->get_origin_offset());
}
void ReflectionProbeGizmo::set_handle(int p_idx, Camera *p_camera, const Point2 &p_point) {
@@ -2474,7 +2474,7 @@ void ReflectionProbeGizmo::set_handle(int p_idx, Camera *p_camera, const Point2
void ReflectionProbeGizmo::commit_handle(int p_idx, const Variant &p_restore, bool p_cancel) {
- Rect3 restore = p_restore;
+ AABB restore = p_restore;
if (p_cancel) {
probe->set_extents(restore.position);
@@ -2499,7 +2499,7 @@ void ReflectionProbeGizmo::redraw() {
Vector<Vector3> internal_lines;
Vector3 extents = probe->get_extents();
- Rect3 aabb;
+ AABB aabb;
aabb.position = -extents;
aabb.size = extents * 2;
@@ -2641,7 +2641,7 @@ void GIProbeGizmo::redraw() {
static const int subdivs[GIProbe::SUBDIV_MAX] = { 64, 128, 256, 512 };
- Rect3 aabb = Rect3(-extents, extents * 2);
+ AABB aabb = AABB(-extents, extents * 2);
int subdiv = subdivs[probe->get_subdiv()];
float cell_size = aabb.get_longest_axis_size() / subdiv;