pub trait XMVectorSwizzle: Sealed {
// Required method
fn XMVectorSwizzle(V: XMVECTOR) -> XMVECTOR;
}
Expand description
Swizzles a vector
Required Methods§
Sourcefn XMVectorSwizzle(V: XMVECTOR) -> XMVECTOR
fn XMVectorSwizzle(V: XMVECTOR) -> XMVECTOR
Swizzles a vector.
§Remarks
This function is a template version of XMVectorSwizzle
where the Swizzle*
arguments are template values.
let a = XMVectorSet(1.0, 2.0, 3.0, 4.0);
let b = <(SwizzleW, SwizzleZ, SwizzleY, SwizzleX)>::XMVectorSwizzle(a);
let c = XMVectorSet(4.0, 3.0, 2.0, 1.0);
assert_eq!(XMVectorGetX(b), XMVectorGetX(c));
assert_eq!(XMVectorGetY(b), XMVectorGetY(c));
assert_eq!(XMVectorGetZ(b), XMVectorGetZ(c));
assert_eq!(XMVectorGetW(b), XMVectorGetW(c));
https://docs.microsoft.com/en-us/windows/win32/dxmath/xmvectorswizzle-template
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.