[NUI] Add new rotation constructor
authorSeungho Baek <sbsh.baek@samsung.com>
Mon, 19 Jul 2021 09:39:46 +0000 (18:39 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Wed, 21 Jul 2021 06:41:03 +0000 (15:41 +0900)
 - Adds new Rotation Constructor that uses two Vector3

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 5b008a6..7297740 100755 (executable)
@@ -21,120 +21,123 @@ namespace Tizen.NUI
     {
         internal static partial class Rotation
         {
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Rotation__SWIG_0")]
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Rotation_0")]
             public static extern global::System.IntPtr NewRotation();
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Rotation__SWIG_1")]
-            public static extern global::System.IntPtr NewRotation(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Rotation_1")]
+            public static extern global::System.IntPtr NewRotation(global::System.Runtime.InteropServices.HandleRef radianAngle, global::System.Runtime.InteropServices.HandleRef vector3);
+
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_new_Rotation_2")]
+            public static extern global::System.IntPtr NewRotation2(global::System.Runtime.InteropServices.HandleRef v0, global::System.Runtime.InteropServices.HandleRef v1);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_delete_Rotation")]
-            public static extern void DeleteRotation(global::System.Runtime.InteropServices.HandleRef jarg1);
+            public static extern void DeleteRotation(global::System.Runtime.InteropServices.HandleRef rotation);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_IDENTITY_get")]
             public static extern global::System.IntPtr IdentityGet();
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_IsIdentity")]
             [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
-            public static extern bool IsIdentity(global::System.Runtime.InteropServices.HandleRef jarg1);
+            public static extern bool IsIdentity(global::System.Runtime.InteropServices.HandleRef rotation);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_GetAxisAngle")]
             [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
-            public static extern bool GetAxisAngle(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3);
+            public static extern bool GetAxisAngle(global::System.Runtime.InteropServices.HandleRef rotation, global::System.Runtime.InteropServices.HandleRef axis, global::System.Runtime.InteropServices.HandleRef radianAngle);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Add")]
-            public static extern global::System.IntPtr Add(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            public static extern global::System.IntPtr Add(global::System.Runtime.InteropServices.HandleRef rotation0, global::System.Runtime.InteropServices.HandleRef rotation1);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Subtract__SWIG_0")]
-            public static extern global::System.IntPtr Subtract(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Subtract_0")]
+            public static extern global::System.IntPtr Subtract(global::System.Runtime.InteropServices.HandleRef rotation0, global::System.Runtime.InteropServices.HandleRef rotation1);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Multiply__SWIG_0")]
-            public static extern global::System.IntPtr MultiplyQuaternion(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Multiply_0")]
+            public static extern global::System.IntPtr MultiplyQuaternion(global::System.Runtime.InteropServices.HandleRef rotation0, global::System.Runtime.InteropServices.HandleRef rotation1);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Multiply__SWIG_1")]
-            public static extern global::System.IntPtr MultiplyVector3(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Multiply_1")]
+            public static extern global::System.IntPtr MultiplyVector3(global::System.Runtime.InteropServices.HandleRef rotation, global::System.Runtime.InteropServices.HandleRef vector);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Divide__SWIG_0")]
-            public static extern global::System.IntPtr Divide(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Divide_0")]
+            public static extern global::System.IntPtr Divide(global::System.Runtime.InteropServices.HandleRef rotation0, global::System.Runtime.InteropServices.HandleRef rotation1);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Multiply__SWIG_2")]
-            public static extern global::System.IntPtr Multiply(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Multiply_2")]
+            public static extern global::System.IntPtr Multiply(global::System.Runtime.InteropServices.HandleRef rotation, float scale);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Divide__SWIG_1")]
-            public static extern global::System.IntPtr Divide(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Divide_1")]
+            public static extern global::System.IntPtr Divide(global::System.Runtime.InteropServices.HandleRef rotation, float scale);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Subtract__SWIG_1")]
-            public static extern global::System.IntPtr Subtract(global::System.Runtime.InteropServices.HandleRef jarg1);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Subtract_1")]
+            public static extern global::System.IntPtr Subtract(global::System.Runtime.InteropServices.HandleRef rotation);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_AddAssign")]
-            public static extern global::System.IntPtr AddAssign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            public static extern global::System.IntPtr AddAssign(global::System.Runtime.InteropServices.HandleRef rotation0, global::System.Runtime.InteropServices.HandleRef rotation1);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_SubtractAssign")]
-            public static extern global::System.IntPtr SubtractAssign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            public static extern global::System.IntPtr SubtractAssign(global::System.Runtime.InteropServices.HandleRef rotation0, global::System.Runtime.InteropServices.HandleRef rotation1);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_MultiplyAssign__SWIG_0")]
-            public static extern global::System.IntPtr MultiplyAssign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_MultiplyAssign_0")]
+            public static extern global::System.IntPtr MultiplyAssign(global::System.Runtime.InteropServices.HandleRef rotation0, global::System.Runtime.InteropServices.HandleRef rotation1);
 
-            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_MultiplyAssign__SWIG_1")]
-            public static extern global::System.IntPtr MultiplyAssign(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_MultiplyAssign_1")]
+            public static extern global::System.IntPtr MultiplyAssign(global::System.Runtime.InteropServices.HandleRef rotation, float scale);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_DivideAssign")]
-            public static extern global::System.IntPtr DivideAssign(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2);
+            public static extern global::System.IntPtr DivideAssign(global::System.Runtime.InteropServices.HandleRef rotation, float scale);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_EqualTo")]
             [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
-            public static extern bool EqualTo(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            public static extern bool EqualTo(global::System.Runtime.InteropServices.HandleRef rotation0, global::System.Runtime.InteropServices.HandleRef rotation1);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_NotEqualTo")]
             [return: global::System.Runtime.InteropServices.MarshalAs(global::System.Runtime.InteropServices.UnmanagedType.U1)]
-            public static extern bool NotEqualTo(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            public static extern bool NotEqualTo(global::System.Runtime.InteropServices.HandleRef rotation0, global::System.Runtime.InteropServices.HandleRef rotation1);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Length")]
-            public static extern float Length(global::System.Runtime.InteropServices.HandleRef jarg1);
+            public static extern float Length(global::System.Runtime.InteropServices.HandleRef rotation);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_LengthSquared")]
-            public static extern float LengthSquared(global::System.Runtime.InteropServices.HandleRef jarg1);
+            public static extern float LengthSquared(global::System.Runtime.InteropServices.HandleRef rotation);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Normalize")]
-            public static extern void Normalize(global::System.Runtime.InteropServices.HandleRef jarg1);
+            public static extern void Normalize(global::System.Runtime.InteropServices.HandleRef rotation);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Normalized")]
-            public static extern global::System.IntPtr Normalized(global::System.Runtime.InteropServices.HandleRef jarg1);
+            public static extern global::System.IntPtr Normalized(global::System.Runtime.InteropServices.HandleRef rotation);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Conjugate")]
-            public static extern void Conjugate(global::System.Runtime.InteropServices.HandleRef jarg1);
+            public static extern void Conjugate(global::System.Runtime.InteropServices.HandleRef rotation);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Invert")]
-            public static extern void Invert(global::System.Runtime.InteropServices.HandleRef jarg1);
+            public static extern void Invert(global::System.Runtime.InteropServices.HandleRef rotation);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Log")]
-            public static extern global::System.IntPtr Log(global::System.Runtime.InteropServices.HandleRef jarg1);
+            public static extern global::System.IntPtr Log(global::System.Runtime.InteropServices.HandleRef rotation);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Exp")]
-            public static extern global::System.IntPtr Exp(global::System.Runtime.InteropServices.HandleRef jarg1);
+            public static extern global::System.IntPtr Exp(global::System.Runtime.InteropServices.HandleRef rotation);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Dot")]
-            public static extern float Dot(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            public static extern float Dot(global::System.Runtime.InteropServices.HandleRef rotation0, global::System.Runtime.InteropServices.HandleRef rotation1);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Lerp")]
-            public static extern global::System.IntPtr Lerp(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, float jarg3);
+            public static extern global::System.IntPtr Lerp(global::System.Runtime.InteropServices.HandleRef rotation0, global::System.Runtime.InteropServices.HandleRef rotation1, float progress);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Slerp")]
-            public static extern global::System.IntPtr Slerp(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, float jarg3);
+            public static extern global::System.IntPtr Slerp(global::System.Runtime.InteropServices.HandleRef rotation0, global::System.Runtime.InteropServices.HandleRef rotation1, float progress);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_SlerpNoInvert")]
-            public static extern global::System.IntPtr SlerpNoInvert(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, float jarg3);
+            public static extern global::System.IntPtr SlerpNoInvert(global::System.Runtime.InteropServices.HandleRef rotation0, global::System.Runtime.InteropServices.HandleRef rotation1, float progress);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Squad")]
-            public static extern global::System.IntPtr Squad(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4, float jarg5);
+            public static extern global::System.IntPtr Squad(global::System.Runtime.InteropServices.HandleRef start, global::System.Runtime.InteropServices.HandleRef end, global::System.Runtime.InteropServices.HandleRef control0, global::System.Runtime.InteropServices.HandleRef control1, float progress);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_AngleBetween")]
-            public static extern float AngleBetween(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
+            public static extern float AngleBetween(global::System.Runtime.InteropServices.HandleRef rotation0, global::System.Runtime.InteropServices.HandleRef rotation1);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Rotate_Vector3")]
-            public static extern global::System.IntPtr RotateVector3(global::System.Runtime.InteropServices.HandleRef nuiRotation, global::System.Runtime.InteropServices.HandleRef nuiVector3);
+            public static extern global::System.IntPtr RotateVector3(global::System.Runtime.InteropServices.HandleRef rotation, global::System.Runtime.InteropServices.HandleRef vector3);
 
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Rotation_Rotate_Vector4")]
-            public static extern global::System.IntPtr RotateVector4(global::System.Runtime.InteropServices.HandleRef nuiRotation, global::System.Runtime.InteropServices.HandleRef nuiVector4);
+            public static extern global::System.IntPtr RotateVector4(global::System.Runtime.InteropServices.HandleRef rotation, global::System.Runtime.InteropServices.HandleRef vector4);
         }
     }
 }
index c42f150..844ee1e 100755 (executable)
@@ -49,6 +49,20 @@ namespace Tizen.NUI
         }
 
         /// <summary>
+        /// The constructor of Rotation which describes minimum rotation to align v0 with v1.
+        /// </summary>
+        /// <param name="v0">The first normalized vector.</param>
+        /// <param name="v1">The second normalized vector.</param>
+        /// <remarks>
+        /// v0 and v1 should be normalized.
+        /// </remarks>
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public Rotation(Vector3 v0, Vector3 v1) : this(Interop.Rotation.NewRotation2(Vector3.getCPtr(v0), Vector3.getCPtr(v1)), true)
+        {
+            if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
+        /// <summary>
         /// (0.0f,0.0f,0.0f,1.0f).
         /// </summary>
         /// <since_tizen> 3 </since_tizen>