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.
 
 
 
 

36 lines
1019 B

namespace UnityEditor.VFX.Operator
{
[VFXHelpURL("Operator-Reciprocal")]
[VFXInfo(name = "Reciprocal (1/x)", category = "Math/Arithmetic", synonyms = new []{ "inverse" })]
class Reciprocal : VFXOperatorNumericUniform
{
public class InputProperties
{
public float x = 1.0f;
}
protected override sealed string operatorName { get { return "Reciprocal (1/x)"; } }
protected override double defaultValueDouble
{
get
{
return 1.0;
}
}
protected override sealed VFXExpression[] BuildExpression(VFXExpression[] inputExpression)
{
var expression = inputExpression[0];
return new[] { VFXOperatorUtility.Reciprocal(expression) };
}
protected sealed override ValidTypeRule typeFilter
{
get
{
return ValidTypeRule.allowEverythingExceptIntegerAndDirection;
}
}
}
}