diff options
Diffstat (limited to 'scene/3d/node_3d.h')
-rw-r--r-- | scene/3d/node_3d.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/scene/3d/node_3d.h b/scene/3d/node_3d.h index d6dcdd96fe..3e21eb12be 100644 --- a/scene/3d/node_3d.h +++ b/scene/3d/node_3d.h @@ -51,6 +51,23 @@ class Node3D : public Node { GDCLASS(Node3D, Node); OBJ_CATEGORY("3D"); +public: + enum RotationEditMode { + ROTATION_EDIT_MODE_EULER, + ROTATION_EDIT_MODE_QUATERNION, + ROTATION_EDIT_MODE_BASIS, + }; + + enum RotationOrder { + ROTATION_ORDER_XYZ, + ROTATION_ORDER_XZY, + ROTATION_ORDER_YXZ, + ROTATION_ORDER_YZX, + ROTATION_ORDER_ZXY, + ROTATION_ORDER_ZYX + }; + +private: enum TransformDirty { DIRTY_NONE = 0, DIRTY_VECTORS = 1, @@ -63,8 +80,10 @@ class Node3D : public Node { struct Data { mutable Transform3D global_transform; mutable Transform3D local_transform; + mutable Basis::EulerOrder rotation_order = Basis::EULER_ORDER_YXZ; mutable Vector3 rotation; mutable Vector3 scale = Vector3(1, 1, 1); + mutable RotationEditMode rotation_edit_mode = ROTATION_EDIT_MODE_EULER; mutable int dirty = DIRTY_NONE; @@ -116,6 +135,8 @@ protected: void _notification(int p_what); static void _bind_methods(); + virtual void _validate_property(PropertyInfo &property) const override; + public: enum { NOTIFICATION_TRANSFORM_CHANGED = SceneTree::NOTIFICATION_TRANSFORM_CHANGED, @@ -130,17 +151,28 @@ public: Ref<World3D> get_world_3d() const; void set_position(const Vector3 &p_position); + + void set_rotation_edit_mode(RotationEditMode p_mode); + RotationEditMode get_rotation_edit_mode() const; + + void set_rotation_order(RotationOrder p_order); void set_rotation(const Vector3 &p_euler_rad); void set_scale(const Vector3 &p_scale); Vector3 get_position() const; + + RotationOrder get_rotation_order() const; Vector3 get_rotation() const; Vector3 get_scale() const; void set_transform(const Transform3D &p_transform); + void set_basis(const Basis &p_basis); + void set_quaternion(const Quaternion &p_quaternion); void set_global_transform(const Transform3D &p_transform); Transform3D get_transform() const; + Basis get_basis() const; + Quaternion get_quaternion() const; Transform3D get_global_transform() const; #ifdef TOOLS_ENABLED @@ -214,4 +246,7 @@ public: Node3D(); }; +VARIANT_ENUM_CAST(Node3D::RotationEditMode) +VARIANT_ENUM_CAST(Node3D::RotationOrder) + #endif // NODE_3D_H |