From: Eunki, Hong Date: Tue, 4 Oct 2022 09:33:27 +0000 (+0900) Subject: [Tizen] Apply ProjectionDirection property when SceneView size changed X-Git-Tag: accepted/tizen/unified/20221005.144446~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3db76e856702eb7153b9cac77d4b4eb04a3374d0;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git [Tizen] Apply ProjectionDirection property when SceneView size changed This reverts commit ede25d85639ad61dfa4a915b9175620bdd20f1cb. Change-Id: Ife7c5099dd89e1d348063272600bcacf27e7a6b1 --- diff --git a/dali-scene3d/internal/controls/scene-view/scene-view-impl.cpp b/dali-scene3d/internal/controls/scene-view/scene-view-impl.cpp index 0c5b7921b2..68adcd2d33 100644 --- a/dali-scene3d/internal/controls/scene-view/scene-view-impl.cpp +++ b/dali-scene3d/internal/controls/scene-view/scene-view-impl.cpp @@ -372,12 +372,20 @@ void SceneView::UpdateRenderTask() Vector3 size = Self().GetProperty(Dali::Actor::Property::SIZE); const float aspectRatio = size.width / size.height; mSelectedCamera.SetAspectRatio(aspectRatio); - const float halfHeight = mSelectedCamera[Dali::CameraActor::Property::TOP_PLANE_DISTANCE]; - const float halfWidth = aspectRatio * halfHeight; + + const bool projectionVertical = mSelectedCamera.GetProperty(Dali::DevelCameraActor::Property::PROJECTION_DIRECTION) == Dali::DevelCameraActor::VERTICAL; + + // if projectionVertical, Top / Bottom is +-ve to keep consistency with orthographic values + // else, Left / Right is +-ve to keep consistency with orthographic values + const float orthographicSize = DALI_LIKELY(projectionVertical) ? mSelectedCamera[Dali::CameraActor::Property::TOP_PLANE_DISTANCE] : mSelectedCamera[Dali::CameraActor::Property::RIGHT_PLANE_DISTANCE]; + const float halfHeight = DALI_LIKELY(projectionVertical) ? orthographicSize : orthographicSize / aspectRatio; + const float halfWidth = DALI_LIKELY(projectionVertical) ? orthographicSize * aspectRatio : orthographicSize; + mSelectedCamera[Dali::CameraActor::Property::LEFT_PLANE_DISTANCE] = -halfWidth; mSelectedCamera[Dali::CameraActor::Property::RIGHT_PLANE_DISTANCE] = halfWidth; - mSelectedCamera[Dali::CameraActor::Property::TOP_PLANE_DISTANCE] = halfHeight; // Top is +ve to keep consistency with orthographic values - mSelectedCamera[Dali::CameraActor::Property::BOTTOM_PLANE_DISTANCE] = -halfHeight; // Bottom is -ve to keep consistency with orthographic values + mSelectedCamera[Dali::CameraActor::Property::TOP_PLANE_DISTANCE] = halfHeight; + mSelectedCamera[Dali::CameraActor::Property::BOTTOM_PLANE_DISTANCE] = -halfHeight; + if(mUseFrameBuffer) { Dali::FrameBuffer currentFrameBuffer = mRenderTask.GetFrameBuffer();