BoundsExtensions.CalculateScale

Extension Method in BoundsExtensions

Declaration

public static float CalculateScale(this Bounds bounds, Bounds areaToFit, float epsilon = 1E-05F)

Description

Calculates the scale of the bounds required to fit inside another bounds.

Parameters

boundsThe bounds to calculate the scale of.
areaToFitThe bounds to fit inside.
epsilonThe minimum value for each axis to be considered (default=0.00001).

Returns

floatThe scale of the bounds required to fit inside the area.

Overload

Declaration

public static float CalculateScale(this BoundsInt bounds, BoundsInt areaToFit)

Description

Calculates the scale of the bounds required to fit inside another bounds.

Parameters

boundsThe bounds to calculate the scale of.
areaToFitThe bounds to fit inside.

Returns

floatThe scale of the bounds required to fit inside the area.