From e379349d2933dbc353cfee3a18c3ba7b02132baf Mon Sep 17 00:00:00 2001 From: seungho baek Date: Thu, 25 May 2023 11:00:16 +0900 Subject: [PATCH] [NUI] Add new constructor to Rotation by using Quaternion vector4 as input parameter Signed-off-by: seungho baek --- src/Tizen.NUI/src/internal/Interop/Interop.Rotation.cs | 3 +++ src/Tizen.NUI/src/public/Common/Rotation.cs | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/Tizen.NUI/src/internal/Interop/Interop.Rotation.cs b/src/Tizen.NUI/src/internal/Interop/Interop.Rotation.cs index 3273505..6940622 100755 --- a/src/Tizen.NUI/src/internal/Interop/Interop.Rotation.cs +++ b/src/Tizen.NUI/src/internal/Interop/Interop.Rotation.cs @@ -33,6 +33,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Rotation_3")] public static extern global::System.IntPtr NewRotation3(global::System.Runtime.InteropServices.HandleRef pitch, global::System.Runtime.InteropServices.HandleRef yaw, global::System.Runtime.InteropServices.HandleRef roll); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Rotation_4")] + public static extern global::System.IntPtr NewRotation4(global::System.Runtime.InteropServices.HandleRef vector4); + [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_Rotation")] public static extern void DeleteRotation(global::System.Runtime.InteropServices.HandleRef rotation); diff --git a/src/Tizen.NUI/src/public/Common/Rotation.cs b/src/Tizen.NUI/src/public/Common/Rotation.cs index 2c303f0..3eac9a4 100755 --- a/src/Tizen.NUI/src/public/Common/Rotation.cs +++ b/src/Tizen.NUI/src/public/Common/Rotation.cs @@ -75,6 +75,16 @@ namespace Tizen.NUI } /// + /// The constructor of Rotation from Quaternion Vector4. + /// + /// Quaternion vector for Rotation. + [EditorBrowsable(EditorBrowsableState.Never)] + public Rotation(Vector4 vector) : this(Interop.Rotation.NewRotation4(Vector4.getCPtr(vector)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// /// (0.0f,0.0f,0.0f,1.0f). /// /// 3 -- 2.7.4