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.
30 lines
905 B
30 lines
905 B
using UnityEngine;
|
|
|
|
namespace UnityEditor.VFX.Operator
|
|
{
|
|
[VFXHelpURL("Operator-Length")]
|
|
[VFXInfo(category = "Math/Vector", synonyms = new []{ "norm", "magnitude" })]
|
|
class Length : VFXOperatorNumericUniform
|
|
{
|
|
public class InputProperties
|
|
{
|
|
[Tooltip("The vector to be used in the length calculation.")]
|
|
public Vector3 x;
|
|
}
|
|
|
|
public class OutputProperties
|
|
{
|
|
[Tooltip("The length of x.")]
|
|
public float l;
|
|
}
|
|
|
|
public override string name => "Length";
|
|
|
|
protected override sealed ValidTypeRule typeFilter { get { return ValidTypeRule.allowEverythingExceptIntegerAndDirection; } }
|
|
|
|
protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputExpression)
|
|
{
|
|
return new[] { VFXOperatorUtility.Length(inputExpression[0]) };
|
|
}
|
|
}
|
|
}
|