XMFLOAT3X3::XMFLOAT3X3 (constfloat*) 函数 (directxmath.h)
从九个元素float
数组初始化 结构的新实例XMFLOAT3X3
。
从 9 元素float
数组初始化 XMFLOAT3X3 结构的新实例。
注意 此构造函数仅在 C++ 下可用。
语法
void XMFLOAT3X3(
const float *pArray
) noexcept;
参数
pArray
9 元素 float
数组的地址,指定 XMFLOAT3X3新实例的每个成员的值。
返回值
无
备注
矩阵元素按行主顺序存储在 pArray 中。
以下两个伪代码示例演示了此构造函数的操作:
XMFLOAT3X3 mat;
mat._11 = pArray[0];
mat._12 = pArray[1];
mat._13 = pArray[2];
mat._21 = pArray[3];
mat._22 = pArray[4];
mat._23 = pArray[5];
mat._31 = pArray[6];
mat._32 = pArray[7];
mat._33 = pArray[8];
或
XMFLOAT3X3 mat;
mat.m[0,0] = pArray[0];
mat.m[0,1] = pArray[1];
mat.m[0,2] = pArray[2];
mat.m[1,0] = pArray[3];
mat.m[1,1] = pArray[4];
mat.m[1,2] = pArray[5];
mat.m[2,0] = pArray[6];
mat.m[2,1] = pArray[7];
mat.m[2,2] = pArray[8];
要求
要求 | 值 |
---|---|
目标平台 | Windows |
标头 | directxmath.h |
另请参阅
引用