You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
991 B
29 lines
991 B
using UnityEngine;
|
|
|
|
namespace UnityEditor.VFX.Operator
|
|
{
|
|
[VFXHelpURL("Operator-RectangularToPolar")]
|
|
[VFXInfo(category = "Math/Coordinates")]
|
|
class RectangularToPolar : VFXOperator
|
|
{
|
|
public class InputProperties
|
|
{
|
|
[Tooltip("Sets the rectangular (x,y) coordinates to convert to polar coordinates (r,θ).")]
|
|
public Vector2 coordinate = Vector2.zero;
|
|
}
|
|
public class OutputProperties
|
|
{
|
|
[Angle, Tooltip("Outputs the angular coordinate (Polar angle).")]
|
|
public float theta = Mathf.PI / 2;
|
|
[Tooltip("Outputs the radial coordinates (Radius).")]
|
|
public float distance = 1.0f;
|
|
}
|
|
|
|
override public string name { get { return "Rectangular to Polar"; } }
|
|
|
|
protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputExpression)
|
|
{
|
|
return VFXOperatorUtility.RectangularToPolar(inputExpression[0]);
|
|
}
|
|
}
|
|
}
|