X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-scene3d%2Finternal%2Fcontrols%2Fscene-view%2Fscene-view-impl.cpp;h=b230f86d4390f737312664d948cdf9fa44949f4b;hb=ca51ee97baf5f41ecf741e22d865ff6c9e0bf769;hp=659dd5a98edc0f382172d90e0f7c45ebcdb66b4e;hpb=b49330a83a1f09d3437225e31619f94efdf97cf3;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git 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 659dd5a..b230f86 100644 --- a/dali-scene3d/internal/controls/scene-view/scene-view-impl.cpp +++ b/dali-scene3d/internal/controls/scene-view/scene-view-impl.cpp @@ -258,6 +258,7 @@ void SceneView::OnInitialize() mRenderTask.SetSourceActor(mRootLayer); mRenderTask.SetExclusive(true); mRenderTask.SetInputEnabled(true); + mRenderTask.SetCullMode(false); mRenderTask.SetScreenToFrameBufferMappingActor(Self()); mDefaultCamera = Dali::CameraActor::New(); @@ -329,25 +330,14 @@ void SceneView::UpdateRenderTask() } Vector3 size = Self().GetProperty(Dali::Actor::Property::SIZE); - float fov = 0.0f; - Vector3 cameraPosition(Vector3::ZERO); - float nearPlain = 1.0f; - float farPlain = 1.0f; - - // Several properties such as fov, nearPlane, farPlane, and position should not be changed after SetPerspectiveProjection is called. - // In the 3D scene, the properties are not changed by the changes of canvas size. - fov = mSelectedCamera[Dali::CameraActor::Property::FIELD_OF_VIEW]; - nearPlain = mSelectedCamera[Dali::CameraActor::Property::NEAR_PLANE_DISTANCE]; - farPlain = mSelectedCamera[Dali::CameraActor::Property::FAR_PLANE_DISTANCE]; - cameraPosition = Vector3(mSelectedCamera[Dali::Actor::Property::POSITION]); - - mSelectedCamera.SetPerspectiveProjection(Dali::Size(size)); - - mSelectedCamera[Dali::CameraActor::Property::FIELD_OF_VIEW] = fov; - mSelectedCamera[Dali::CameraActor::Property::NEAR_PLANE_DISTANCE] = nearPlain; - mSelectedCamera[Dali::CameraActor::Property::FAR_PLANE_DISTANCE] = farPlain; - mSelectedCamera[Dali::Actor::Property::POSITION] = cameraPosition; - + 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; + 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 if(mUseFrameBuffer) { Dali::FrameBuffer currentFrameBuffer = mRenderTask.GetFrameBuffer();