private static float CovertUnitToGlobalScale(EFileUnit measurement, float unit) { switch (measurement) { case EFileUnit.Meters: return(0.0254f * unit); case EFileUnit.Centimeters: return(0.000254f * unit); case EFileUnit.Millimeters: return(unit * 2.54E-05f); case EFileUnit.Feet: return(unit * 0.00774192f); case EFileUnit.Inches: return(unit); } Debug.LogError("File Unit value is invalid"); return(1f); }
private static float ConvertGlobalScaleToUnit(EFileUnit measurement, float globalScale) { switch (measurement) { case EFileUnit.Meters: return(globalScale / 0.0254f); case EFileUnit.Centimeters: return(globalScale / 0.000254f); case EFileUnit.Millimeters: return(globalScale / 2.54E-05f); case EFileUnit.Feet: return(globalScale / 0.00774192f); case EFileUnit.Inches: return(globalScale); } Debug.LogError("File Unit value is invalid"); return(1f); }
static float ConvertGlobalScaleToUnit(EFileUnit measurement, float globalScale) { switch (measurement) { case EFileUnit.Meters: // meter return(globalScale / kInchToMeter); case EFileUnit.Centimeters: //centimeter return(globalScale / (kInchToMeter * 0.01f)); case EFileUnit.Millimeters: //millimeter return(globalScale / (kInchToMeter * 0.001f)); case EFileUnit.Feet: //feet return(globalScale / (kInchToMeter * 0.3048f)); case EFileUnit.Inches: //inches return(globalScale); } Debug.LogError("File Unit value is invalid"); return(1.0f); }
static float CovertUnitToGlobalScale(EFileUnit measurement, float unit) { switch (measurement) { case EFileUnit.Meters: // meter return(kInchToMeter * unit); case EFileUnit.Centimeters: //centimeter return((kInchToMeter * 0.01f) * unit); case EFileUnit.Millimeters: //millimeter return(unit * (kInchToMeter * 0.001f)); case EFileUnit.Feet: //feet return(unit * (kInchToMeter * 0.3048f)); case EFileUnit.Inches: //inches return(unit); } Debug.LogError("File Unit value is invalid"); return(1.0f); }
private static float CovertUnitToGlobalScale(EFileUnit measurement, float unit) { switch (measurement) { case EFileUnit.Meters: return (0.0254f * unit); case EFileUnit.Centimeters: return (0.000254f * unit); case EFileUnit.Millimeters: return (unit * 2.54E-05f); case EFileUnit.Feet: return (unit * 0.00774192f); case EFileUnit.Inches: return unit; } Debug.LogError("File Unit value is invalid"); return 1f; }
private static float ConvertGlobalScaleToUnit(EFileUnit measurement, float globalScale) { switch (measurement) { case EFileUnit.Meters: return (globalScale / 0.0254f); case EFileUnit.Centimeters: return (globalScale / 0.000254f); case EFileUnit.Millimeters: return (globalScale / 2.54E-05f); case EFileUnit.Feet: return (globalScale / 0.00774192f); case EFileUnit.Inches: return globalScale; } Debug.LogError("File Unit value is invalid"); return 1f; }