Type Alias

simd_float3

A vector of three 32-bit single-precision values.

Declaration

typealias simd_float3 = SIMD3<Float>

Topics

Vector Creation Functions

func simd_make_float3(simd_float16) -> simd_float3

Returns a new vector by truncating the specified vector.

func simd_make_float3(simd_float8) -> simd_float3

Returns a new vector by truncating the specified vector.

func simd_make_float3(Float) -> simd_float3

Returns a new vector with the first element set to a scalar value, and other elements set to zero.

func simd_make_float3(simd_float2) -> simd_float3

Returns a new vector with the first and second elements from a two-element vector, and other elements set to zero.

func simd_make_float3(simd_float3) -> simd_float3

Returns a new vector from a three-element vector.

func simd_make_float3(simd_float4) -> simd_float3

Returns a new vector from the first, second, and third elements of a four-element vector.

func simd_make_float3(Float, Float, Float) -> simd_float3

Returns a new vector from 3 scalar values.

func simd_make_float3(Float, simd_float2) -> simd_float3

Returns a new vector from a scalar value and a two-element vector.

func simd_make_float3(simd_float2, Float) -> simd_float3

Returns a new vector from a scalar value and a two-element vector.

func simd_make_float3_undef(Float) -> simd_float3

Returns a new vector with the first element set to a scalar value, and other elements undefined.

func simd_make_float3_undef(simd_float2) -> simd_float3

Returns a new vector with the first and second elements from a two-element vector, and other elements undefined.

Common Functions

func simd_abs(simd_float3) -> simd_float3

Returns the absolute value of each element in a vector.

func simd_clamp(simd_float3, simd_float3, simd_float3) -> simd_float3

Returns each element in a vector clamped to a specified range.

func simd_sign(simd_float3) -> simd_float3

Returns the sign of each element in a vector.

func simd_fract(simd_float3) -> simd_float3

Returns the fractional part of each element in a vector.

func simd_step(simd_float3, simd_float3) -> simd_float3

Returns zero for each element in a vector less than a specified edge; one otherwise.

func simd_equal(simd_float3, simd_float3) -> simd_bool

Returns true if all elements of a vector are equal; false otherwise.

Reduce Functions

func simd_reduce_add(simd_float3) -> Float

Returns the sum of all elements in a vector.

func simd_reduce_max(simd_float3) -> Float

Returns the maximum value in a vector.

func simd_reduce_min(simd_float3) -> Float

Returns the miniumum value in a vector.

Interpolation Functions

func simd_mix(simd_float3, simd_float3, simd_float3) -> simd_float3

Returns an elementwise linearly interpolated value between two vectors.

func simd_smoothstep(simd_float3, simd_float3, simd_float3) -> simd_float3

Returns an elementwise smoothly interpolated value between two vectors.

Extrema Functions

func simd_max(simd_float3, simd_float3) -> simd_float3

Returns the maximum value of each element in a vector.

func simd_min(simd_float3, simd_float3) -> simd_float3

Returns the minimum value of each element in a vector.

Reciprocal and Reciprocal Square Root Functions

func simd_recip(simd_float3) -> simd_float3

Returns the reciprocal of each element in a vector.

func simd_rsqrt(simd_float3) -> simd_float3

Returns the reciprocal square root of each element in a vector.

func simd_precise_recip(simd_float3) -> simd_float3

Returns the precise reciprocal of each element in a vector.

func simd_precise_rsqrt(simd_float3) -> simd_float3

Returns the precise reciprocal square root of each element in a vector.

func simd_fast_recip(simd_float3) -> simd_float3

Returns the fast reciprocal of each element in a vector.

func simd_fast_rsqrt(simd_float3) -> simd_float3

Returns the fast reciprocal square root of each element in a vector.

Geometry Functions

func simd_cross(simd_float3, simd_float3) -> simd_float3

Returns the cross product of two vectors.

func simd_dot(simd_float3, simd_float3) -> Float

Returns the dot product of two vectors.

func simd_normalize(simd_float3) -> simd_float3

Returns a vector pointing in the same direction of the supplied vector with a length of 1.

func simd_orient(simd_float3, simd_float3, simd_float3) -> Float

Tests the orientation of the three supplied vectors.

func simd_project(simd_float3, simd_float3) -> simd_float3

Returns the first vector projected onto the second vector.

func simd_precise_normalize(simd_float3) -> simd_float3

Returns the precise normalized vector.

func simd_fast_normalize(simd_float3) -> simd_float3

Returns the fast normalized vector.

func simd_distance_squared(simd_float3, simd_float3) -> Float

Returns the square of the distance between two vectors.

func simd_length(simd_float3) -> Float

Returns the length of a vector.

func simd_length_squared(simd_float3) -> Float

Returns the square of the length of a vector.

func simd_norm_inf(simd_float3) -> Float

Returns the inf-norm (the maximum absolute value) of a vector.

func simd_norm_one(simd_float3) -> Float

Returns the one-norm (the sum of absolute values) of a vector.

func simd_refract(simd_float3, simd_float3, Float) -> simd_float3

Returns the refraction direction of an incident vector, a unit normal vector, and an index of refraction eta.

func simd_reflect(simd_float3, simd_float3) -> simd_float3

Returns the reflection direction of an incident vector and a unit normal vector.

Logic Functions

func simd_select(simd_float3, simd_float3, simd_int3) -> simd_float3

Returns a vector containing elements from either the first or second parameter, depending on the high-order bit of the corresponding element in the third parameter.

func simd_bitselect(simd_float3, simd_float3, simd_int3) -> simd_float3

Returns a vector containing elements from either the first or second parameter, depending on the corresponding element in the third parameter.

Math Functions

func ceil(SIMD3<Float>) -> SIMD3<Float>

Returns the ceiling of each element in a vector.

func floor(SIMD3<Float>) -> SIMD3<Float>

Returns the floor of each element in a vector.

func simd_muladd(simd_float3, simd_float3, simd_float3) -> simd_float3

Returns the multiply-add result for corresponding elements in three vectors.

func trunc(SIMD3<Float>) -> SIMD3<Float>

Returns each element in a vector rounded toward zero to the nearest integer.

See Also

Vectors: Single-Precision Values

typealias simd_float2

A vector of two 32-bit single-precision values.

typealias simd_float4

A vector of four 32-bit single-precision values.