summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2021-08-19 11:21:56 -0700
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2021-08-24 17:34:55 -0700
commit3d5dc80348b9b377f6d8a33c7101d54b337396a5 (patch)
tree70705bf5e02804bc2eaffe9315205a128d4a1c9e /editor
parentaa4791735d2fe92d747a39529aebb410f96cf38f (diff)
Rename RayShape to SeparationRayShape
Makes it clearer that it's used for special cases when picking a collision shape.
Diffstat (limited to 'editor')
-rw-r--r--editor/icons/SeparationRayShape2D.svg (renamed from editor/icons/RayShape2D.svg)0
-rw-r--r--editor/icons/SeparationRayShape3D.svg (renamed from editor/icons/RayShape3D.svg)0
-rw-r--r--editor/import/resource_importer_scene.cpp4
-rw-r--r--editor/plugins/collision_shape_2d_editor_plugin.cpp22
-rw-r--r--editor/plugins/collision_shape_2d_editor_plugin.h2
-rw-r--r--editor/plugins/node_3d_editor_gizmos.cpp22
6 files changed, 25 insertions, 25 deletions
diff --git a/editor/icons/RayShape2D.svg b/editor/icons/SeparationRayShape2D.svg
index aa8cee1210..aa8cee1210 100644
--- a/editor/icons/RayShape2D.svg
+++ b/editor/icons/SeparationRayShape2D.svg
diff --git a/editor/icons/RayShape3D.svg b/editor/icons/SeparationRayShape3D.svg
index 44d32fe83b..44d32fe83b 100644
--- a/editor/icons/RayShape3D.svg
+++ b/editor/icons/SeparationRayShape3D.svg
diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp
index ef5e124ad9..c2244befa1 100644
--- a/editor/import/resource_importer_scene.cpp
+++ b/editor/import/resource_importer_scene.cpp
@@ -45,8 +45,8 @@
#include "scene/resources/animation.h"
#include "scene/resources/box_shape_3d.h"
#include "scene/resources/packed_scene.h"
-#include "scene/resources/ray_shape_3d.h"
#include "scene/resources/resource_format_text.h"
+#include "scene/resources/separation_ray_shape_3d.h"
#include "scene/resources/sphere_shape_3d.h"
#include "scene/resources/surface_tool.h"
#include "scene/resources/world_margin_shape_3d.h"
@@ -381,7 +381,7 @@ Node *ResourceImporterScene::_pre_fix_node(Node *p_node, Node *p_root, Map<Ref<E
boxShape->set_size(Vector3(2, 2, 2));
colshape->set_shape(boxShape);
} else if (empty_draw_type == "SINGLE_ARROW") {
- RayShape3D *rayShape = memnew(RayShape3D);
+ SeparationRayShape3D *rayShape = memnew(SeparationRayShape3D);
rayShape->set_length(1);
colshape->set_shape(rayShape);
Object::cast_to<Node3D>(sb)->rotate_x(Math_PI / 2);
diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp
index bfb7a68c35..bfcc293625 100644
--- a/editor/plugins/collision_shape_2d_editor_plugin.cpp
+++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp
@@ -36,9 +36,9 @@
#include "scene/resources/circle_shape_2d.h"
#include "scene/resources/concave_polygon_shape_2d.h"
#include "scene/resources/convex_polygon_shape_2d.h"
-#include "scene/resources/ray_shape_2d.h"
#include "scene/resources/rectangle_shape_2d.h"
#include "scene/resources/segment_shape_2d.h"
+#include "scene/resources/separation_ray_shape_2d.h"
#include "scene/resources/world_margin_shape_2d.h"
void CollisionShape2DEditor::_node_removed(Node *p_node) {
@@ -81,8 +81,8 @@ Variant CollisionShape2DEditor::get_handle_value(int idx) const {
} break;
- case RAY_SHAPE: {
- Ref<RayShape2D> ray = node->get_shape();
+ case SEPARATION_RAY_SHAPE: {
+ Ref<SeparationRayShape2D> ray = node->get_shape();
if (idx == 0) {
return ray->get_length();
@@ -162,8 +162,8 @@ void CollisionShape2DEditor::set_handle(int idx, Point2 &p_point) {
} break;
- case RAY_SHAPE: {
- Ref<RayShape2D> ray = node->get_shape();
+ case SEPARATION_RAY_SHAPE: {
+ Ref<SeparationRayShape2D> ray = node->get_shape();
ray->set_length(Math::abs(p_point.y));
@@ -272,8 +272,8 @@ void CollisionShape2DEditor::commit_handle(int idx, Variant &p_org) {
} break;
- case RAY_SHAPE: {
- Ref<RayShape2D> ray = node->get_shape();
+ case SEPARATION_RAY_SHAPE: {
+ Ref<SeparationRayShape2D> ray = node->get_shape();
undo_redo->add_do_method(ray.ptr(), "set_length", ray->get_length());
undo_redo->add_do_method(canvas_item_editor, "update_viewport");
@@ -423,8 +423,8 @@ void CollisionShape2DEditor::_get_current_shape_type() {
shape_type = CONVEX_POLYGON_SHAPE;
} else if (Object::cast_to<WorldMarginShape2D>(*s)) {
shape_type = WORLD_MARGIN_SHAPE;
- } else if (Object::cast_to<RayShape2D>(*s)) {
- shape_type = RAY_SHAPE;
+ } else if (Object::cast_to<SeparationRayShape2D>(*s)) {
+ shape_type = SEPARATION_RAY_SHAPE;
} else if (Object::cast_to<RectangleShape2D>(*s)) {
shape_type = RECTANGLE_SHAPE;
} else if (Object::cast_to<SegmentShape2D>(*s)) {
@@ -502,8 +502,8 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla
} break;
- case RAY_SHAPE: {
- Ref<RayShape2D> shape = node->get_shape();
+ case SEPARATION_RAY_SHAPE: {
+ Ref<SeparationRayShape2D> shape = node->get_shape();
handles.resize(1);
handles.write[0] = Point2(0, shape->get_length());
diff --git a/editor/plugins/collision_shape_2d_editor_plugin.h b/editor/plugins/collision_shape_2d_editor_plugin.h
index eab80a419b..421e674df8 100644
--- a/editor/plugins/collision_shape_2d_editor_plugin.h
+++ b/editor/plugins/collision_shape_2d_editor_plugin.h
@@ -47,7 +47,7 @@ class CollisionShape2DEditor : public Control {
CONCAVE_POLYGON_SHAPE,
CONVEX_POLYGON_SHAPE,
WORLD_MARGIN_SHAPE,
- RAY_SHAPE,
+ SEPARATION_RAY_SHAPE,
RECTANGLE_SHAPE,
SEGMENT_SHAPE
};
diff --git a/editor/plugins/node_3d_editor_gizmos.cpp b/editor/plugins/node_3d_editor_gizmos.cpp
index a23886b9e7..d04e88e915 100644
--- a/editor/plugins/node_3d_editor_gizmos.cpp
+++ b/editor/plugins/node_3d_editor_gizmos.cpp
@@ -66,7 +66,7 @@
#include "scene/resources/cylinder_shape_3d.h"
#include "scene/resources/height_map_shape_3d.h"
#include "scene/resources/primitive_meshes.h"
-#include "scene/resources/ray_shape_3d.h"
+#include "scene/resources/separation_ray_shape_3d.h"
#include "scene/resources/sphere_shape_3d.h"
#include "scene/resources/surface_tool.h"
#include "scene/resources/world_margin_shape_3d.h"
@@ -4068,7 +4068,7 @@ String CollisionShape3DGizmoPlugin::get_handle_name(const EditorNode3DGizmo *p_g
return p_id == 0 ? "Radius" : "Height";
}
- if (Object::cast_to<RayShape3D>(*s)) {
+ if (Object::cast_to<SeparationRayShape3D>(*s)) {
return "Length";
}
@@ -4103,8 +4103,8 @@ Variant CollisionShape3DGizmoPlugin::get_handle_value(const EditorNode3DGizmo *p
return p_id == 0 ? cs2->get_radius() : cs2->get_height();
}
- if (Object::cast_to<RayShape3D>(*s)) {
- Ref<RayShape3D> cs2 = s;
+ if (Object::cast_to<SeparationRayShape3D>(*s)) {
+ Ref<SeparationRayShape3D> cs2 = s;
return cs2->get_length();
}
@@ -4143,8 +4143,8 @@ void CollisionShape3DGizmoPlugin::set_handle(const EditorNode3DGizmo *p_gizmo, i
ss->set_radius(d);
}
- if (Object::cast_to<RayShape3D>(*s)) {
- Ref<RayShape3D> rs = s;
+ if (Object::cast_to<SeparationRayShape3D>(*s)) {
+ Ref<SeparationRayShape3D> rs = s;
Vector3 ra, rb;
Geometry3D::get_closest_points_between_segments(Vector3(), Vector3(0, 0, 4096), sg[0], sg[1], ra, rb);
float d = ra.z;
@@ -4314,15 +4314,15 @@ void CollisionShape3DGizmoPlugin::commit_handle(const EditorNode3DGizmo *p_gizmo
ur->commit_action();
}
- if (Object::cast_to<RayShape3D>(*s)) {
- Ref<RayShape3D> ss = s;
+ if (Object::cast_to<SeparationRayShape3D>(*s)) {
+ Ref<SeparationRayShape3D> ss = s;
if (p_cancel) {
ss->set_length(p_restore);
return;
}
UndoRedo *ur = Node3DEditor::get_singleton()->get_undo_redo();
- ur->create_action(TTR("Change Ray Shape Length"));
+ ur->create_action(TTR("Change Separation Ray Shape Length"));
ur->add_do_method(ss.ptr(), "set_length", ss->get_length());
ur->add_undo_method(ss.ptr(), "set_length", p_restore);
ur->commit_action();
@@ -4597,8 +4597,8 @@ void CollisionShape3DGizmoPlugin::redraw(EditorNode3DGizmo *p_gizmo) {
p_gizmo->add_collision_segments(cs2->get_debug_mesh_lines());
}
- if (Object::cast_to<RayShape3D>(*s)) {
- Ref<RayShape3D> rs = s;
+ if (Object::cast_to<SeparationRayShape3D>(*s)) {
+ Ref<SeparationRayShape3D> rs = s;
Vector<Vector3> points;
points.push_back(Vector3());