[NUI] Add view helper API to rotate : LookAt
authorEunki, Hong <eunkiki.hong@samsung.com>
Wed, 5 Apr 2023 01:55:44 +0000 (10:55 +0900)
committerSangHyeon Jade Lee <dltkdgus1764@gmail.com>
Wed, 5 Apr 2023 12:12:53 +0000 (21:12 +0900)
Add helper API to rotate View
Note that this API change View's Orientation property

Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
src/Tizen.NUI/src/internal/Interop/Interop.ActorInternal.cs
src/Tizen.NUI/src/public/BaseComponents/ViewPublicMethods.cs

index 026a57c..46162e1 100755 (executable)
@@ -137,6 +137,9 @@ namespace Tizen.NUI
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_ScaleBy")]
             public static extern void ScaleBy(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2);
 
+            [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_LookAt")]
+            public static extern void LookAt(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4, global::System.Runtime.InteropServices.HandleRef jarg5);
+
             [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_Actor_GetCurrentScale")]
             public static extern global::System.IntPtr GetCurrentScale(global::System.Runtime.InteropServices.HandleRef jarg1);
 
index b9aebe9..a04f6a7 100755 (executable)
@@ -684,6 +684,24 @@ namespace Tizen.NUI.BaseComponents
                 throw NDalicPINVOKE.SWIGPendingException.Retrieve();
         }
 
+        /// <summary>
+        /// Rotate the view look at specific position.
+        /// It will change the view's orientation property.
+        /// </summary>
+        /// <remark>Target position should be setup by world coordinates.</remark>
+        /// <param name="target">The target world position to look at.</param>
+        /// <param name="up">The up vector after target look at. If it is null, up vector become +Y axis</param>
+        /// <param name="localForward">The forward vector of view when it's orientation is not applied. If it is null, localForward vector become +Z axis</param>
+        /// <param name="localUp">The up vector of view when it's orientation is not applied. If it is null, localUp vector become +Y axis</param>
+        /// This will be public opened in tizen_next after ACR done. Before ACR, need to be hidden as inhouse API.
+        [EditorBrowsable(EditorBrowsableState.Never)]
+        public void LookAt(Vector3 target, Vector3 up = null, Vector3 localForward = null, Vector3 localUp = null)
+        {
+            Interop.ActorInternal.LookAt(SwigCPtr, Vector3.getCPtr(target), Vector3.getCPtr(up), Vector3.getCPtr(localForward), Vector3.getCPtr(localUp));
+            if (NDalicPINVOKE.SWIGPendingException.Pending)
+                throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+        }
+
         /// This will be public opened in next tizen after ACR done. Before ACR, need to be hidden as inhouse API.
         [EditorBrowsable(EditorBrowsableState.Never)]
         public void SetColorMode(ColorMode colorMode)