0

我正在尝试从世界矩阵中提取一行以放入我的前向向量中,当在更新函数中调用该向量时,将使飞机向前移动。目前我有这个工作但我直接访问成员,是否有一个函数可以自动从我的矩阵中拉出一行?

// [Skip this step first time through] Get the forward vector out of the world matrix and put it in m_vForwardVector
XMFLOAT4X4 f44;                                                         //create a 4x4 float
XMStoreFloat4x4(&f44, m_mWorldMatrix);                                  //pass the world matrix into the 4x4 float

 m_vForwardVector = XMVectorSet(f44._31, f44._32, f44._33, f44._34);    //pass the forward vector values from the world matrix into the forward vector
4

1 回答 1

2

我已经解决了,比我想象的要简单得多啊哈

m_vForwardVector = (m_mWorldMatrix.r[2]);
于 2017-10-31T11:20:27.710 回答