select
Returns trueValue if test is true, falseValue otherwise.
Read time 13 minutesLast updated 11 days ago
Definition
- Type: Method
- Namespace: Unity.Mathematics
- Assembly: UnityEngine.MathematicsModule
select(bool, bool, bool)
Returns trueValue if test is true, falseValue otherwise.
public static bool select(bool falseValue, bool trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| bool | The selection between falseValue and trueValue according to bool test. |
select(bool2, bool2, bool)
Returns trueValue if test is true, falseValue otherwise.
public static bool2 select(bool2 falseValue, bool2 trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| bool2 | The selection between falseValue and trueValue according to bool test. |
select(bool3, bool3, bool)
Returns trueValue if test is true, falseValue otherwise.
public static bool3 select(bool3 falseValue, bool3 trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| bool3 | The selection between falseValue and trueValue according to bool test. |
select(bool4, bool4, bool)
Returns trueValue if test is true, falseValue otherwise.
public static bool4 select(bool4 falseValue, bool4 trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| bool4 | The selection between falseValue and trueValue according to bool test. |
select(bool2, bool2, bool2)
Returns a componentwise selection between two bool2 vectors falseValue and trueValue based on a bool2 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.
public static bool2 select(bool2 falseValue, bool2 trueValue, bool2 test)
Parameters
Returns
Type | Description |
|---|---|
| bool2 | The componentwise selection between falseValue and trueValue according to selection mask test. |
select(bool3, bool3, bool3)
Returns a componentwise selection between two bool3 vectors falseValue and trueValue based on a bool3 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.
public static bool3 select(bool3 falseValue, bool3 trueValue, bool3 test)
Parameters
Returns
Type | Description |
|---|---|
| bool3 | The componentwise selection between falseValue and trueValue according to selection mask test. |
select(bool4, bool4, bool4)
Returns a componentwise selection between two bool4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.
public static bool4 select(bool4 falseValue, bool4 trueValue, bool4 test)
Parameters
Returns
Type | Description |
|---|---|
| bool4 | The componentwise selection between falseValue and trueValue according to selection mask test. |
select(int, int, bool)
Returns trueValue if test is true, falseValue otherwise.
public static int select(int falseValue, int trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| int | The selection between falseValue and trueValue according to bool test. |
select(int2, int2, bool)
Returns trueValue if test is true, falseValue otherwise.
public static int2 select(int2 falseValue, int2 trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| int2 | The selection between falseValue and trueValue according to bool test. |
select(int3, int3, bool)
Returns trueValue if test is true, falseValue otherwise.
public static int3 select(int3 falseValue, int3 trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| int3 | The selection between falseValue and trueValue according to bool test. |
select(int4, int4, bool)
Returns trueValue if test is true, falseValue otherwise.
public static int4 select(int4 falseValue, int4 trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| int4 | The selection between falseValue and trueValue according to bool test. |
select(int2, int2, bool2)
Returns a componentwise selection between two int2 vectors falseValue and trueValue based on a bool2 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.
public static int2 select(int2 falseValue, int2 trueValue, bool2 test)
Parameters
Returns
Type | Description |
|---|---|
| int2 | The componentwise selection between falseValue and trueValue according to selection mask test. |
select(int3, int3, bool3)
Returns a componentwise selection between two int3 vectors falseValue and trueValue based on a bool3 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.
public static int3 select(int3 falseValue, int3 trueValue, bool3 test)
Parameters
Returns
Type | Description |
|---|---|
| int3 | The componentwise selection between falseValue and trueValue according to selection mask test. |
select(int4, int4, bool4)
Returns a componentwise selection between two int4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.
public static int4 select(int4 falseValue, int4 trueValue, bool4 test)
Parameters
Returns
Type | Description |
|---|---|
| int4 | The componentwise selection between falseValue and trueValue according to selection mask test. |
select(uint, uint, bool)
Returns trueValue if test is true, falseValue otherwise.
public static uint select(uint falseValue, uint trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| uint | The selection between falseValue and trueValue according to bool test. |
select(uint2, uint2, bool)
Returns trueValue if test is true, falseValue otherwise.
public static uint2 select(uint2 falseValue, uint2 trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| uint2 | The selection between falseValue and trueValue according to bool test. |
select(uint3, uint3, bool)
Returns trueValue if test is true, falseValue otherwise.
public static uint3 select(uint3 falseValue, uint3 trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| uint3 | The selection between falseValue and trueValue according to bool test. |
select(uint4, uint4, bool)
Returns trueValue if test is true, falseValue otherwise.
public static uint4 select(uint4 falseValue, uint4 trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| uint4 | The selection between falseValue and trueValue according to bool test. |
select(uint2, uint2, bool2)
Returns a componentwise selection between two uint2 vectors falseValue and trueValue based on a bool2 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.
public static uint2 select(uint2 falseValue, uint2 trueValue, bool2 test)
Parameters
Returns
Type | Description |
|---|---|
| uint2 | The componentwise selection between falseValue and trueValue according to selection mask test. |
select(uint3, uint3, bool3)
Returns a componentwise selection between two uint3 vectors falseValue and trueValue based on a bool3 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.
public static uint3 select(uint3 falseValue, uint3 trueValue, bool3 test)
Parameters
Returns
Type | Description |
|---|---|
| uint3 | The componentwise selection between falseValue and trueValue according to selection mask test. |
select(uint4, uint4, bool4)
Returns a componentwise selection between two uint4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.
public static uint4 select(uint4 falseValue, uint4 trueValue, bool4 test)
Parameters
Returns
Type | Description |
|---|---|
| uint4 | The componentwise selection between falseValue and trueValue according to selection mask test. |
select(long, long, bool)
Returns trueValue if test is true, falseValue otherwise.
public static long select(long falseValue, long trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| long | The selection between falseValue and trueValue according to bool test. |
select(ulong, ulong, bool)
Returns trueValue if test is true, falseValue otherwise.
public static ulong select(ulong falseValue, ulong trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| ulong | The selection between falseValue and trueValue according to bool test. |
select(float, float, bool)
Returns trueValue if test is true, falseValue otherwise.
public static float select(float falseValue, float trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| float | The selection between falseValue and trueValue according to bool test. |
select(float2, float2, bool)
Returns trueValue if test is true, falseValue otherwise.
public static float2 select(float2 falseValue, float2 trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| float2 | The selection between falseValue and trueValue according to bool test. |
select(float3, float3, bool)
Returns trueValue if test is true, falseValue otherwise.
public static float3 select(float3 falseValue, float3 trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| float3 | The selection between falseValue and trueValue according to bool test. |
select(float4, float4, bool)
Returns trueValue if test is true, falseValue otherwise.
public static float4 select(float4 falseValue, float4 trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| float4 | The selection between falseValue and trueValue according to bool test. |
select(float2, float2, bool2)
Returns a componentwise selection between two float2 vectors falseValue and trueValue based on a bool2 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.
public static float2 select(float2 falseValue, float2 trueValue, bool2 test)
Parameters
Returns
Type | Description |
|---|---|
| float2 | The componentwise selection between falseValue and trueValue according to selection mask test. |
select(float3, float3, bool3)
Returns a componentwise selection between two float3 vectors falseValue and trueValue based on a bool3 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.
public static float3 select(float3 falseValue, float3 trueValue, bool3 test)
Parameters
Returns
Type | Description |
|---|---|
| float3 | The componentwise selection between falseValue and trueValue according to selection mask test. |
select(float4, float4, bool4)
Returns a componentwise selection between two float4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.
public static float4 select(float4 falseValue, float4 trueValue, bool4 test)
Parameters
Returns
Type | Description |
|---|---|
| float4 | The componentwise selection between falseValue and trueValue according to selection mask test. |
select(double, double, bool)
Returns trueValue if test is true, falseValue otherwise.
public static double select(double falseValue, double trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| double | The selection between falseValue and trueValue according to bool test. |
select(double2, double2, bool)
Returns trueValue if test is true, falseValue otherwise.
public static double2 select(double2 falseValue, double2 trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| double2 | The selection between falseValue and trueValue according to bool test. |
select(double3, double3, bool)
Returns trueValue if test is true, falseValue otherwise.
public static double3 select(double3 falseValue, double3 trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| double3 | The selection between falseValue and trueValue according to bool test. |
select(double4, double4, bool)
Returns trueValue if test is true, falseValue otherwise.
public static double4 select(double4 falseValue, double4 trueValue, bool test)
Parameters
Returns
Type | Description |
|---|---|
| double4 | The selection between falseValue and trueValue according to bool test. |
select(double2, double2, bool2)
Returns a componentwise selection between two double2 vectors falseValue and trueValue based on a bool2 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.
public static double2 select(double2 falseValue, double2 trueValue, bool2 test)
Parameters
Returns
Type | Description |
|---|---|
| double2 | The componentwise selection between falseValue and trueValue according to selection mask test. |
select(double3, double3, bool3)
Returns a componentwise selection between two double3 vectors falseValue and trueValue based on a bool3 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.
public static double3 select(double3 falseValue, double3 trueValue, bool3 test)
Parameters
Returns
Type | Description |
|---|---|
| double3 | The componentwise selection between falseValue and trueValue according to selection mask test. |
select(double4, double4, bool4)
Returns a componentwise selection between two double4 vectors falseValue and trueValue based on a bool4 selection mask test. Per component, the component from trueValue is selected when test is true, otherwise the component from falseValue is selected.
public static double4 select(double4 falseValue, double4 trueValue, bool4 test)
Parameters
Returns
Type | Description |
|---|---|
| double4 | The componentwise selection between falseValue and trueValue according to selection mask test. |