Macro shades::vec4 [−][src]
Create 4D scalar vectors via different forms.
This macro allows to create 4D (V4
) scalar vectors from several forms:
vec4!(xyzw)
, which acts as the cast operator. Only typesT
satisfyingVec4
are castable.vec4!(xyz, w)
, which builds aV4<T>
withxyz
a value that can be turned into aExpr<V3<T>>
andw: T
.vec4!(xy, zw)
, which builds aV4<T>
withxy
andzw
values that can be turned intoExpr<V3<T>>
.vec4!(xy, z, w)
, which builds aV4<T>
withxy
,z: T
andw: T
.vec4!(x, y, z, w)
, which builds aV3<T>
forx: T
,y: T
andz: T
.
Examples
use shades::{vec2, vec3, vec4}; let _ = vec4!(1, 2, 3, 4); let _ = vec4!(vec3!(1, 2, 3), 4); let _ = vec4!(vec2!(1, 2), vec2!(3, 4)); let _ = vec4!(vec2!(1, 2), 3, 4);