summaryrefslogtreecommitdiffstats
path: root/editor/plugins/path_3d_editor_plugin.h
diff options
context:
space:
mode:
authorDaniel Roberts <ademan555@gmail.com>2022-11-17 09:42:00 -0600
committerYaohua Xiong <xiongyaohua@gmail.com>2023-08-12 14:55:38 +0800
commit46e395abb1e9280cb636192bdf7d0b6ba80911a9 (patch)
treeb306b7088c242d281cfeea9d261a9c3a6c96164e /editor/plugins/path_3d_editor_plugin.h
parent4714e95896c8db02616ea6ec7f9aff92dec1cae4 (diff)
downloadredot-engine-46e395abb1e9280cb636192bdf7d0b6ba80911a9.tar.gz
Add handles to control Curve3D tilt
Diffstat (limited to 'editor/plugins/path_3d_editor_plugin.h')
-rw-r--r--editor/plugins/path_3d_editor_plugin.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/editor/plugins/path_3d_editor_plugin.h b/editor/plugins/path_3d_editor_plugin.h
index e670e28644..9cac6e395a 100644
--- a/editor/plugins/path_3d_editor_plugin.h
+++ b/editor/plugins/path_3d_editor_plugin.h
@@ -42,11 +42,26 @@ class MenuButton;
class Path3DGizmo : public EditorNode3DGizmo {
GDCLASS(Path3DGizmo, EditorNode3DGizmo);
+ // Map handle id to control point id and handle type.
+ enum HandleType {
+ HANDLE_TYPE_IN,
+ HANDLE_TYPE_OUT,
+ HANDLE_TYPE_TILT,
+ };
+
+ struct HandleInfo {
+ int point_idx; // Index of control point.
+ HandleType type; // Type of this handle.
+ };
+
Path3D *path = nullptr;
mutable Vector3 original;
mutable float orig_in_length;
mutable float orig_out_length;
+ // Cache information of secondary handles.
+ Vector<HandleInfo> _secondary_handles_info;
+
public:
virtual String get_handle_name(int p_id, bool p_secondary) const override;
virtual Variant get_handle_value(int p_id, bool p_secondary) const override;