protected static D3DXVECTOR2 GetNewVector(float heading) { var updatedMatrix = new D3DXMATRIX(); var transMatrix = new D3DXMATRIX(); var yRotationMatrix = new D3DXMATRIX(); //Set up the rotation matrix for the player model D3DXMatrixRotationY(&yRotationMatrix, heading / 2); //Set up the translation matrix D3DXMatrixTranslation(&transMatrix, 0.0f, 0.0f, 0.0f); //Combine out matrices D3DXMatrixMultiply(&updatedMatrix, &yRotationMatrix, &transMatrix); //Return new vector for player matrix. return(new D3DXVECTOR2(updatedMatrix._31, updatedMatrix._33)); }
private static extern IntPtr D3DXMatrixTranslation( out D3DXMATRIX pOut, Single x, Single y, Single z );
private static extern IntPtr D3DXMatrixRotationY( out D3DXMATRIX pOut, Single Angle );
private static extern IntPtr D3DXMatrixMultiply( out D3DXMATRIX pOut, ref D3DXMATRIX pM1, ref D3DXMATRIX pM2 );