[NUI] Add new constructor to Rotation by using Quaternion vector4 as input parameter
authorseungho baek <sbsh.baek@samsung.com>
Thu, 25 May 2023 02:00:16 +0000 (11:00 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 31 May 2023 05:47:13 +0000 (14:47 +0900)
Signed-off-by: seungho baek <sbsh.baek@samsung.com>
src/Tizen.NUI/src/internal/Interop/Interop.Rotation.cs
src/Tizen.NUI/src/public/Common/Rotation.cs

index 32735055881d77958e05cff3321847cd0b7b1d43..6940622f00c336687dfdd4e6e370e9cc2f6db09b 100755 (executable)
@@ -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);
 
index 2c303f0ff8da5df7e334655d78f3be5a6f7f378c..3eac9a41ed36af9937f0d00f141b4a4afdbd8b09 100755 (executable)
@@ -74,6 +74,16 @@ namespace Tizen.NUI
             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        /// <summary>
+        /// The constructor of Rotation from Quaternion Vector4.
+        /// </summary>
+        /// <param name="vector">Quaternion vector for Rotation.</param>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Rotation(Vector4 vector) : this(Interop.Rotation.NewRotation4(Vector4.getCPtr(vector)), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
         /// <summary>
         /// (0.0f,0.0f,0.0f,1.0f).
         /// </summary>