@@ -691,19 +691,19 @@ Vector3 Node3DEditorViewport::_get_camera_position() const {
691691 return _get_camera_transform ().origin ;
692692}
693693
694- Point2 Node3DEditorViewport::_point_to_screen (const Vector3 &p_point) {
694+ Point2 Node3DEditorViewport::point_to_screen (const Vector3 &p_point) {
695695 return camera->unproject_position (p_point) * subviewport_container->get_stretch_shrink ();
696696}
697697
698- Vector3 Node3DEditorViewport::_get_ray_pos (const Vector2 &p_pos) const {
698+ Vector3 Node3DEditorViewport::get_ray_pos (const Vector2 &p_pos) const {
699699 return camera->project_ray_origin (p_pos / subviewport_container->get_stretch_shrink ());
700700}
701701
702702Vector3 Node3DEditorViewport::_get_camera_normal () const {
703703 return -_get_camera_transform ().basis .get_column (2 );
704704}
705705
706- Vector3 Node3DEditorViewport::_get_ray (const Vector2 &p_pos) const {
706+ Vector3 Node3DEditorViewport::get_ray (const Vector2 &p_pos) const {
707707 return camera->project_ray_normal (p_pos / subviewport_container->get_stretch_shrink ());
708708}
709709
@@ -769,8 +769,8 @@ void Node3DEditorViewport::_select_clicked(bool p_allow_locked) {
769769}
770770
771771ObjectID Node3DEditorViewport::_select_ray (const Point2 &p_pos) const {
772- Vector3 ray = _get_ray (p_pos);
773- Vector3 pos = _get_ray_pos (p_pos);
772+ Vector3 ray = get_ray (p_pos);
773+ Vector3 pos = get_ray_pos (p_pos);
774774 Vector2 shrinked_pos = p_pos / subviewport_container->get_stretch_shrink ();
775775
776776 if (viewport->get_debug_draw () == Viewport::DEBUG_DRAW_SDFGI_PROBES) {
@@ -837,8 +837,8 @@ ObjectID Node3DEditorViewport::_select_ray(const Point2 &p_pos) const {
837837}
838838
839839void Node3DEditorViewport::_find_items_at_pos (const Point2 &p_pos, Vector<_RayResult> &r_results, bool p_include_locked_nodes) {
840- Vector3 ray = _get_ray (p_pos);
841- Vector3 pos = _get_ray_pos (p_pos);
840+ Vector3 ray = get_ray (p_pos);
841+ Vector3 pos = get_ray_pos (p_pos);
842842
843843 Vector<ObjectID> instances = RenderingServer::get_singleton ()->instances_cull_ray (pos, pos + ray * camera->get_far (), get_tree ()->get_root ()->get_world_3d ()->get_scenario ());
844844 HashSet<Node3D *> found_nodes;
@@ -1153,8 +1153,8 @@ void Node3DEditorViewport::_update_name() {
11531153
11541154void Node3DEditorViewport::_compute_edit (const Point2 &p_point) {
11551155 _edit.original_local = spatial_editor->are_local_coords_enabled ();
1156- _edit.click_ray = _get_ray (p_point);
1157- _edit.click_ray_pos = _get_ray_pos (p_point);
1156+ _edit.click_ray = get_ray (p_point);
1157+ _edit.click_ray_pos = get_ray_pos (p_point);
11581158 _edit.plane = TRANSFORM_VIEW;
11591159 spatial_editor->update_transform_gizmo ();
11601160 _edit.center = spatial_editor->get_gizmo_transform ().origin ;
@@ -1233,8 +1233,8 @@ bool Node3DEditorViewport::_transform_gizmo_select(const Vector2 &p_screenpos, b
12331233 return false ;
12341234 }
12351235
1236- Vector3 ray_pos = _get_ray_pos (p_screenpos);
1237- Vector3 ray = _get_ray (p_screenpos);
1236+ Vector3 ray_pos = get_ray_pos (p_screenpos);
1237+ Vector3 ray = get_ray (p_screenpos);
12381238
12391239 Transform3D gt = spatial_editor->get_gizmo_transform ();
12401240
@@ -3115,7 +3115,7 @@ void Node3DEditorViewport::_draw() {
31153115 }
31163116
31173117 if (_edit.mode == TRANSFORM_ROTATE && _edit.show_rotation_line ) {
3118- Point2 center = _point_to_screen (_edit.center );
3118+ Point2 center = point_to_screen (_edit.center );
31193119
31203120 Color handle_color;
31213121 switch (_edit.plane ) {
@@ -4087,8 +4087,8 @@ Vector3 Node3DEditorViewport::_get_instance_position(const Point2 &p_pos) const
40874087 const float MAX_DISTANCE = 50.0 ;
40884088 const float FALLBACK_DISTANCE = 5.0 ;
40894089
4090- Vector3 world_ray = _get_ray (p_pos);
4091- Vector3 world_pos = _get_ray_pos (p_pos);
4090+ Vector3 world_ray = get_ray (p_pos);
4091+ Vector3 world_pos = get_ray_pos (p_pos);
40924092
40934093 PhysicsDirectSpaceState3D *ss = get_tree ()->get_root ()->get_world_3d ()->get_direct_space_state ();
40944094
@@ -4250,8 +4250,8 @@ bool Node3DEditorViewport::_apply_preview_material(ObjectID p_target, const Poin
42504250 Ref<Mesh> mesh = mesh_instance->get_mesh ();
42514251 int surface_count = mesh->get_surface_count ();
42524252
4253- Vector3 world_ray = _get_ray (p_point);
4254- Vector3 world_pos = _get_ray_pos (p_point);
4253+ Vector3 world_ray = get_ray (p_point);
4254+ Vector3 world_pos = get_ray_pos (p_point);
42554255
42564256 int closest_surface = -1 ;
42574257 float closest_dist = 1e20 ;
@@ -4698,8 +4698,8 @@ void Node3DEditorViewport::apply_transform(Vector3 p_motion, double p_snap) {
46984698
46994699// Update the current transform operation in response to an input.
47004700void Node3DEditorViewport::update_transform (bool p_shift) {
4701- Vector3 ray_pos = _get_ray_pos (_edit.mouse_pos );
4702- Vector3 ray = _get_ray (_edit.mouse_pos );
4701+ Vector3 ray_pos = get_ray_pos (_edit.mouse_pos );
4702+ Vector3 ray = get_ray (_edit.mouse_pos );
47034703 double snap = EDITOR_GET (" interface/inspector/default_float_step" );
47044704 int snap_step_decimals = Math::range_step_decimals (snap);
47054705
0 commit comments