Revert "[Tizen] Temporary fix, Will be removed later, Fix Emul crash issue"
[platform/core/uifw/dali-core.git] / dali / public-api / math / vector3.cpp
index 7d5c4c7..2b410d0 100644 (file)
@@ -179,149 +179,4 @@ Vector3 Clamp( const Vector3& v, const float& min, const float& max )
   return result;
 }
 
-Vector3 FitKeepAspectRatio( const Vector3& target, const Vector3& source )
-{
-  float scale = 0.0f;
-
-  if ( fabsf(source.x) > 0.0f )
-  {
-    scale = target.x / source.x;
-  }
-
-  if ( fabsf(source.y) > 0.0f )
-  {
-    if ( scale > Math::MACHINE_EPSILON_1 )
-    {
-      scale =  std::min( scale, target.y / source.y );
-    }
-    else
-    {
-      scale = target.y / source.y;
-    }
-  }
-
-  if ( fabsf(source.z) > 0.0f )
-  {
-    if ( scale > Math::MACHINE_EPSILON_1 )
-    {
-      scale =  std::min( scale, target.z / source.z );
-    }
-    else
-    {
-      scale = target.z / source.z;
-    }
-  }
-
-  if ( scale < Math::MACHINE_EPSILON_1 )
-  {
-    scale = 1.0f;
-  }
-
-  return Vector3( scale, scale, scale );
-}
-
-Vector3 FillKeepAspectRatio( const Vector3& target, const Vector3& source )
-{
-  float scale = 0.0f;
-
-  if ( fabsf(source.x) > 0.0f )
-  {
-    scale = target.x / source.x;
-  }
-
-  if ( fabsf(source.y) > 0.0f )
-  {
-    if ( scale > Math::MACHINE_EPSILON_1 )
-    {
-      scale =  std::max( scale, target.y / source.y );
-    }
-    else
-    {
-      scale = target.y / source.y;
-    }
-  }
-
-  if ( fabsf(source.z) > 0.0f )
-  {
-    if ( scale > Math::MACHINE_EPSILON_1 )
-    {
-      scale =  std::max( scale, target.z / source.z );
-    }
-    else
-    {
-      scale = target.z / source.z;
-    }
-  }
-
-  if ( scale < Math::MACHINE_EPSILON_1 )
-  {
-    scale = 1.0f;
-  }
-
-  return Vector3( scale, scale, scale );
-}
-
-Vector3 FillXYKeepAspectRatio( const Vector3& target, const Vector3& source )
-{
-  float scale = 0.0f;
-
-  if ( fabsf(source.x) > 0.0f )
-  {
-    scale = target.x / source.x;
-  }
-
-  if ( fabsf(source.y) > 0.0f )
-  {
-    if ( scale > Math::MACHINE_EPSILON_1 )
-    {
-      scale =  std::max( scale, target.y / source.y );
-    }
-    else
-    {
-      scale = target.y / source.y;
-    }
-  }
-
-  if ( scale < Math::MACHINE_EPSILON_1 )
-  {
-    scale = 1.0f;
-  }
-
-  return Vector3( scale, scale, scale );
-}
-
-Vector3 ShrinkInsideKeepAspectRatio( const Vector3& target, const Vector3& source )
-{
-  // calculate source size vs target size to see if we need to shrink
-  float widthScale = 1.0f;
-  if( target.width < source.width )
-  {
-    // not enough width, width needs to shrink
-    widthScale = target.width / source.width;
-  }
-  float heightScale = 1.0f;
-  if( target.height < source.height )
-  {
-    // not enough height, height needs to shrink
-    heightScale = target.height / source.height;
-  }
-  float depthScale = 1.0f;
-  if( target.depth < source.depth )
-  {
-    // not enough depth, depth needs to shrink
-    depthScale = target.depth / source.depth;
-  }
-  // use smaller of the scales
-  float scale = std::min( std::min( widthScale, heightScale ), depthScale );
-
-  // check if we need to scale
-  if( scale < 1.0f )
-  {
-    // scale natural size to fit inside
-    return Vector3( scale, scale, scale );
-  }
-  // there is enough space so use source size
-  return Vector3::ONE;
-}
-
 } // namespace Dali