Function directx_math::XMLoadFloat4x3[][src]

pub fn XMLoadFloat4x3(pSource: &XMFLOAT4X3) -> XMMATRIX

Loads an XMFLOAT4X3 into an XMMATRIX.

Parameters

pSource Address of the XMFLOAT4X3 structure to load. This parameter must point to cached memory.

Return value

Returns an XMMATRIX loaded with the data from the pSource parameter. This function performs a partial load of the returned XMMATRIX. See Getting Started for more information.

Remarks

XMFLOAT4X3 is a row-major form of the matrix. This function cannot be used to read column-major data since it assumes the last column is 0 0 0 1.

The members of the XMFLOAT4X3 structure (_11, _12, _13, and so on) are loaded into the corresponding members of the XMMATRIX. The remaining members of the returned XMMATRIX are 0.0, except for _44, which is 1.0.

Example

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

let m = XMLoadFloat4x3(&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-XMLoadFloat4x3