From: seungho baek Date: Wed, 15 Nov 2023 14:36:34 +0000 (+0900) Subject: [NUI] Add ModelPivotPoint property X-Git-Tag: submit/tizen_7.0/20231115.150413~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5587fe09902e42d22af0fd0cada4566fb4d109e2;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git [NUI] Add ModelPivotPoint property Signed-off-by: seungho baek --- diff --git a/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs b/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs index 784f46bba..ae240950a 100755 --- a/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs +++ b/src/Tizen.NUI.Scene3D/src/public/Controls/Model.cs @@ -76,6 +76,7 @@ namespace Tizen.NUI.Scene3D /// 10 public partial class Model : View { + private Position modelPivotPoint = new Position(); internal Model(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { } @@ -96,6 +97,7 @@ namespace Tizen.NUI.Scene3D { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); this.PositionUsesPivotPoint = true; + ResourcesLoaded += OnResourcesLoaded; } /// @@ -133,6 +135,22 @@ namespace Tizen.NUI.Scene3D return ret; } + /// + /// Get The original pivot point of the model + /// + /// + /// This returns (0, 0, 0) before resources are loaded. + /// + // This will be public opened after ACR done. (Before ACR, need to be hidden as Inhouse API) + [EditorBrowsable(EditorBrowsableState.Never)] + public Position ModelPivotPoint + { + get + { + return modelPivotPoint; + } + } + /// /// Set/Get the ImageBasedLight ScaleFactor. /// Scale factor controls light source intensity in [0.0f, 1.0f] @@ -617,6 +635,26 @@ namespace Tizen.NUI.Scene3D return scaleFactor; } + private void OnResourcesLoaded(object sender, EventArgs e) + { + this.modelPivotPoint.X = this.PivotPoint.X; + this.modelPivotPoint.Y = this.PivotPoint.Y; + this.modelPivotPoint.Z = this.PivotPoint.Z; + } + + /// + /// To make transitionSet instance be disposed. + /// + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + ResourcesLoaded -= OnResourcesLoaded; + base.Dispose(type); + } + /// /// Release swigCPtr. ///