Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


step

Returns the result of a step function where the result is 1.0f when x \>= threshold and 0.0f otherwise.
Read time 3 minutesLast updated 7 days ago

Definition

step(float, float)

Returns the result of a step function where the result is 1.0f when x \>= threshold and 0.0f otherwise.
public static float step(float threshold, float x)

Parameters

threshold

Value to be used as a threshold for returning 1.

Value to compare against threshold.

Returns

Type

Description

float1 if the comparison x \>= threshold is true, otherwise 0.

step(float2, float2)

Returns the result of a componentwise step function where each component is 1.0f when x \>= threshold and 0.0f otherwise.
public static float2 step(float2 threshold, float2 x)

Parameters

threshold

Vector of values to be used as a threshold for returning 1.

Vector of values to compare against threshold.

Returns

Type

Description

float21 if the componentwise comparison x \>= threshold is true, otherwise 0.

step(float3, float3)

Returns the result of a componentwise step function where each component is 1.0f when x \>= threshold and 0.0f otherwise.
public static float3 step(float3 threshold, float3 x)

Parameters

threshold

Vector of values to be used as a threshold for returning 1.

Vector of values to compare against threshold.

Returns

Type

Description

float31 if the componentwise comparison x \>= threshold is true, otherwise 0.

step(float4, float4)

Returns the result of a componentwise step function where each component is 1.0f when x \>= threshold and 0.0f otherwise.
public static float4 step(float4 threshold, float4 x)

Parameters

threshold

Vector of values to be used as a threshold for returning 1.

Vector of values to compare against threshold.

Returns

Type

Description

float41 if the componentwise comparison x \>= threshold is true, otherwise 0.

step(double, double)

Returns the result of a step function where the result is 1.0f when x \>= threshold and 0.0f otherwise.
public static double step(double threshold, double x)

Parameters

threshold

Values to be used as a threshold for returning 1.

Value to compare against threshold.

Returns

Type

Description

double1 if the comparison x \>= threshold is true, otherwise 0.

step(double2, double2)

Returns the result of a componentwise step function where each component is 1.0f when x \>= threshold and 0.0f otherwise.
public static double2 step(double2 threshold, double2 x)

Parameters

threshold

Vector of values to be used as a threshold for returning 1.

Vector of values to compare against threshold.

Returns

Type

Description

double21 if the componentwise comparison x \>= threshold is true, otherwise 0.

step(double3, double3)

Returns the result of a componentwise step function where each component is 1.0f when x \>= threshold and 0.0f otherwise.
public static double3 step(double3 threshold, double3 x)

Parameters

threshold

Vector of values to be used as a threshold for returning 1.

Vector of values to compare against threshold.

Returns

Type

Description

double31 if the componentwise comparison x \>= threshold is true, otherwise 0.

step(double4, double4)

Returns the result of a componentwise step function where each component is 1.0f when x \>= threshold and 0.0f otherwise.
public static double4 step(double4 threshold, double4 x)

Parameters

threshold

Vector of values to be used as a threshold for returning 1.

Vector of values to compare against threshold.

Returns

Type

Description

double41 if the componentwise comparison x \>= threshold is true, otherwise 0.