Function directx_math::XMLoadFloat3x4[][src]

pub fn XMLoadFloat3x4(pSource: &XMFLOAT3X4) -> XMMATRIX

Loads an XMFLOAT3X4 into an XMMATRIX.

Parameters

pSource Type: const XMFLOAT3X4 *Pointer to the constant XMFLOAT3X4 structure to load. This argument must point to cached memory.

Return value

Type: XMMATRIX An XMMATRIX loaded with the data from the pSource argument. This function performs a partial load of the returned XMMATRIX. For more info, see Getting started (DirectXMath).

Remarks

XMFLOAT3X4 is a row-major form of the matrix. XMLoadFloat3x4 could be used to read column-major data, but that would then need to be transposed with XMMatrixTranspose before use in other XMMATRIX functions.

Example

let data = XMFLOAT3X4::from([
    [10.0, 13.0, 16.0, 19.0],
    [11.0, 14.0, 17.0, 20.0],
    [12.0, 15.0, 18.0, 21.0],
]);

let m = XMLoadFloat3x4(&data);
let m: [[f32; 4]; 4] = XMMatrix(m).into();
assert_eq!(m, [
    [10.0, 11.0, 12.0, 0.0],
    [13.0, 14.0, 15.0, 0.0],
    [16.0, 17.0, 18.0, 0.0],
    [19.0, 20.0, 21.0, 1.0],
]);

Reference

https://docs.microsoft.com/en-us/windows/win32/api/directxmath/nf-directxmath-XMLoadFloat3x4