/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
using namespace Dali;
-void LookAt(Matrix& result, const Vector3& eye, const Vector3& target, const Vector3& up)
-{
- Vector3 vZ = target - eye;
- vZ.Normalize();
-
- Vector3 vX = up.Cross(vZ);
- vX.Normalize();
-
- Vector3 vY = vZ.Cross(vX);
- vY.Normalize();
-
- result.SetInverseTransformComponents(vX, vY, vZ, eye);
-}
-
-
Model3dView::Model3dView()
- : Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) )
+: Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) )
{
mIlluminationType = Toolkit::Model3dView::DIFFUSE_WITH_NORMAL_MAP;
{
impl.LoadMaterial();
impl.CreateMaterial();
+ impl.LoadTextures();
}
break;
}
void Model3dView::OnStageConnection( int depth )
{
- Control::OnStageConnection( depth );
-
CustomActor self = Self();
self.AddRenderer( mRenderer );
if( mObjLoader.IsSceneLoaded() )
{
- mMesh = mObjLoader.CreateGeometry( GetShaderProperties( mIlluminationType ) );
+ mMesh = mObjLoader.CreateGeometry( GetShaderProperties( mIlluminationType ), true );
CreateMaterial();
LoadTextures();
constraint.AddSource( Source( self, Toolkit::Model3dView::Property::LIGHT_POSITION ) );
constraint.Apply();
}
+
+ Control::OnStageConnection( depth );
}
///////////////////////////////////////////////////////////
{
if( mObjLoader.IsSceneLoaded() )
{
- mMesh = mObjLoader.CreateGeometry( GetShaderProperties( mIlluminationType ) );
+ mMesh = mObjLoader.CreateGeometry( GetShaderProperties( mIlluminationType ), true );
if( mRenderer )
{
mRenderer.SetGeometry( mMesh );
mRenderer.SetProperty( Renderer::Property::DEPTH_WRITE_MODE, DepthWriteMode::ON );
+ mRenderer.SetProperty( Renderer::Property::DEPTH_TEST_MODE, DepthTestMode::ON );
}
}
}