Repository: godotengine/godot
File: editor/plugins/node_3d_editor_plugin.h (C/C++)

Code before:
	void set_can_preview(Camera3D *p_preview);

	void set_preview_material(Ref<Material> p_material) { preview_material = p_material; }
	Ref<Material> get_preview_material() { return preview_material; }
	void set_preview_reset_material(Ref<Material> p_material) { preview_reset_material = p_material; }
	Ref<Material> get_preview_reset_material() const { return preview_reset_material; }
	void set_preview_material_target(ObjectID p_object_id) { preview_material_target = p_object_id; }
	ObjectID get_preview_material_target() const { return preview_material_target; }
	void set_preview_material_surface(int p_surface) { preview_material_surface = p_surface; }
	int get_preview_material_surface() const { return preview_material_surface; }

	Node3DEditorViewport *get_editor_viewport(int p_idx) {
		ERR_FAIL_INDEX_V(p_idx, static_cast<int>(VIEWPORTS_COUNT), nullptr);
		return viewports[p_idx];
	}

	void add_gizmo_plugin(Ref<EditorNode3DGizmoPlugin> p_plugin);
	void remove_gizmo_plugin(Ref<EditorNode3DGizmoPlugin> p_plugin);

	void edit(Node3D *p_spatial);
	void clear();

	Node3DEditor();
	~Node3DEditor();
};

class Node3DEditorPlugin : public EditorPlugin {
	GDCLASS(Node3DEditorPlugin, EditorPlugin);

	Node3DEditor *spatial_editor = nullptr;

public:
	Node3DEditor *get_spatial_editor() { return spatial_editor; }
	virtual String get_name() const override { return "3D"; }
	bool has_main_screen() const override { return true; }
	virtual void make_visible(bool p_visible) override;
	virtual void edit(Object *p_object) override;
	virtual bool handles(Object *p_object) const override;

	virtual Dictionary get_state() const override;
	virtual void set_state(const Dictionary &p_state) override;
	virtual void clear() override { spatial_editor->clear(); }

	virtual void edited_scene_changed() override;

	Node3DEditorPlugin();
	~Node3DEditorPlugin();
};

class ViewportNavigationControl : public Control {
	GDCLASS(ViewportNavigationControl, Control);

Review comment (suggestion):
```suggestion
	Vector<Node3D *> gizmo_bvh_ray_query(const Vector3 &p_ray_start, const Vector3 &p_ray_end);
```

Code after:
		return current_hover_gizmo_handle;
	}

	void set_can_preview(Camera3D *p_preview);

	void set_preview_material(Ref<Material> p_material) { preview_material = p_material; }
	Ref<Material> get_preview_material() { return preview_material; }
	void set_preview_reset_material(Ref<Material> p_material) { preview_reset_material = p_material; }
	Ref<Material> get_preview_reset_material() const { return preview_reset_material; }
	void set_preview_material_target(ObjectID p_object_id) { preview_material_target = p_object_id; }
	ObjectID get_preview_material_target() const { return preview_material_target; }
	void set_preview_material_surface(int p_surface) { preview_material_surface = p_surface; }
	int get_preview_material_surface() const { return preview_material_surface; }

	Node3DEditorViewport *get_editor_viewport(int p_idx) {
		ERR_FAIL_INDEX_V(p_idx, static_cast<int>(VIEWPORTS_COUNT), nullptr);
		return viewports[p_idx];
	}

	void add_gizmo_plugin(Ref<EditorNode3DGizmoPlugin> p_plugin);
	void remove_gizmo_plugin(Ref<EditorNode3DGizmoPlugin> p_plugin);

	DynamicBVH::ID insert_gizmo_bvh_node(Node3D *p_node, const AABB &p_aabb);
	void update_gizmo_bvh_node(DynamicBVH::ID p_id, const AABB &p_aabb);
	void remove_gizmo_bvh_node(DynamicBVH::ID p_id);
	Vector<Node3D *> gizmo_bvh_ray_query(const Vector3 &p_ray_start, const Vector3 &p_ray_end);
	Vector<Node3D *> gizmo_bvh_frustum_query(const Vector<Plane> &p_frustum);

	void edit(Node3D *p_spatial);
	void clear();

	Node3DEditor();
	~Node3DEditor();
};

class Node3DEditorPlugin : public EditorPlugin {
	GDCLASS(Node3DEditorPlugin, EditorPlugin);

	Node3DEditor *spatial_editor = nullptr;

public:
	Node3DEditor *get_spatial_editor() { return spatial_editor; }
	virtual String get_name() const override { return "3D"; }
	bool has_main_screen() const override { return true; }
	virtual void make_visible(bool p_visible) override;
	virtual void edit(Object *p_object) override;
	virtual bool handles(Object *p_object) const override;

	virtual Dictionary get_state() const override;
	virtual void set_state(const Dictionary &p_state) override;
	virtual void clear() override { spatial_editor->clear(); }