X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fscene3d-view%2Fscene3d-view-impl.cpp;h=1521ae909e7a1b2968e7cf9e89056c3b39f92343;hp=3ec462b08af4af40725af6ff99807aef2604f8e5;hb=b1e8521ad77e7b4e62b59613b2edef64429130e9;hpb=7742c07e1fdc5d78bab7c2c9cc5d7803f04fb012 diff --git a/dali-toolkit/internal/controls/scene3d-view/scene3d-view-impl.cpp b/dali-toolkit/internal/controls/scene3d-view/scene3d-view-impl.cpp index 3ec462b..1521ae9 100644 --- a/dali-toolkit/internal/controls/scene3d-view/scene3d-view-impl.cpp +++ b/dali-toolkit/internal/controls/scene3d-view/scene3d-view-impl.cpp @@ -21,6 +21,9 @@ // EXTERNAL INCLUDES #include +// INTERNAL INCLUDES +#include + namespace Dali { @@ -33,6 +36,8 @@ namespace Internal namespace { +const char* const IMAGE_BRDF_FILE_NAME = "brdfLUT.png"; + // glTF file extension const std::string GLTF_EXT( ".gltf" ); @@ -208,7 +213,8 @@ void Scene3dView::SetCubeMap( const std::string& diffuseTexturePath, const std:: mLightType = Toolkit::Scene3dView::LightType::IMAGE_BASED_LIGHT; // BRDF texture - std::string imageBrdfUrl = DALI_IMAGE_DIR "brdfLUT.png"; + const std::string imageDirPath = AssetManager::GetDaliImagePath(); + const std::string imageBrdfUrl = imageDirPath + IMAGE_BRDF_FILE_NAME; mBRDFTexture = LoadTexture( imageBrdfUrl.c_str(), true ); if( !mBRDFTexture ) { @@ -240,11 +246,11 @@ void Scene3dView::SetCubeMap( const std::string& diffuseTexturePath, const std:: bool Scene3dView::SetDefaultCamera( const Dali::Camera::Type type, const float nearPlane, const Vector3 cameraPosition ) { - mDefaultCamera.SetParentOrigin( ParentOrigin::CENTER ); - mDefaultCamera.SetAnchorPoint( AnchorPoint::CENTER ); + mDefaultCamera.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mDefaultCamera.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); mDefaultCamera.SetType( type ); mDefaultCamera.SetNearClippingPlane( nearPlane ); - mDefaultCamera.SetPosition( cameraPosition ); + mDefaultCamera.SetProperty( Actor::Property::POSITION, cameraPosition ); return true; } @@ -281,7 +287,7 @@ uint32_t Scene3dView::GetCameraCount() CameraActor Scene3dView::GetCamera( uint32_t cameraIndex ) { CameraActor cameraActor; - if( cameraIndex < 0 || cameraIndex >= mCameraActorArray.size() ) + if( cameraIndex >= mCameraActorArray.size() ) { return cameraActor; } @@ -346,19 +352,19 @@ Texture Scene3dView::LoadTexture( const char *imageUrl, bool generateMipmaps ) void Scene3dView::OnInitialize() { - mRoot.SetParentOrigin( ParentOrigin::CENTER ); - mRoot.SetAnchorPoint( AnchorPoint::CENTER ); + mRoot.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + mRoot.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); Layer layer = Layer::New(); - layer.SetBehavior( Layer::LAYER_3D ); - layer.SetParentOrigin( ParentOrigin::CENTER ); - layer.SetAnchorPoint( AnchorPoint::CENTER ); + layer.SetProperty( Layer::Property::BEHAVIOR, Layer::LAYER_3D ); + layer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + layer.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); layer.Add( mRoot ); Actor self = Self(); // Apply some default resizing rules. - self.SetParentOrigin( ParentOrigin::CENTER ); - self.SetAnchorPoint( AnchorPoint::CENTER ); + self.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER ); + self.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER ); self.Add( layer ); CreateScene();