void SetAxisInfo() { if (mainTargetRoot != null) { float size = handleLength * GetDistanceMultiplier(); axisInfo.Set(mainTargetRoot, pivotPoint, size, space); if (isTransforming && type == TransformType.Scale) { if (nearAxis == Axis.Any) { axisInfo.Set(mainTargetRoot, pivotPoint, size + totalScaleAmount, space); } if (nearAxis == Axis.X) { axisInfo.xAxisEnd += (axisInfo.xDirection * totalScaleAmount); } if (nearAxis == Axis.Y) { axisInfo.yAxisEnd += (axisInfo.yDirection * totalScaleAmount); } if (nearAxis == Axis.Z) { axisInfo.zAxisEnd += (axisInfo.zDirection * totalScaleAmount); } } } }
void SetAxisInfo() { float size = handleLength * GetDistanceMultiplier(); axisInfo.Set(target, size, space); if (isTransforming && type == TransformType.Scale) { if (selectedAxis == Axis.Any) { axisInfo.Set(target, size + totalScaleAmount, space); } if (selectedAxis == Axis.X) { axisInfo.xAxisEnd += (axisInfo.xDirection * totalScaleAmount); } if (selectedAxis == Axis.Y) { axisInfo.yAxisEnd += (axisInfo.yDirection * totalScaleAmount); } if (selectedAxis == Axis.Z) { axisInfo.zAxisEnd += (axisInfo.zDirection * totalScaleAmount); } } }
//float DistanceFromMouseToPlane(List<Vector3> planeLines) //{ // if (planeLines.Count >= 4) // { // Ray mouseRay = myCamera.ScreenPointToRay(Input.mousePosition); // Plane plane = new Plane(planeLines[0], planeLines[1], planeLines[2]); // float distanceToPlane; // if (plane.Raycast(mouseRay, out distanceToPlane)) // { // Vector3 pointOnPlane = mouseRay.origin + (mouseRay.direction * distanceToPlane); // Vector3 planeCenter = (planeLines[0] + planeLines[1] + planeLines[2] + planeLines[3]) / 4f; // return Vector3.Distance(planeCenter, pointOnPlane); // } // } // return float.MaxValue; //} void SetAxisInfo() { if (mainTargetRoot != null) { axisInfo.Set(mainTargetRoot, pivotPoint, GetProperTransformSpace()); } }
void SetAxisInfo() { if (mainTargetRoot != null) { axisInfo.Set(mainTargetRoot, pivotPoint, space); } }