void CSpatialFrame::RotateAbout(D3DXVECTOR3 _Point, float _fDegPitch, float _fDegYaw, float _fDegRoll)
{ D3DXMATRIX RotationMatrix; D3DXMatrixRotationYawPitchRoll(&RotationMatrix, D3DXToRadian( _fDegYaw ), D3DXToRadian( _fDegPitch ), D3DXToRadian( _fDegRoll )); D3DXVECTOR3 playerPos = m_Position; m_Position = _Point;
{
D3DXMATRIX RotationMatrix;
D3DXMatrixRotationYawPitchRoll(&RotationMatrix, D3DXToRadian( _fDegYaw ), D3DXToRadian( _fDegPitch ), D3DXToRadian( _fDegRoll ));
D3DXVECTOR3 playerPos = m_Position;
m_Position = _Point;
D3DXMATRIX PlayerMatrix;
PlayerMatrix._11 = m_RightVector.x;
PlayerMatrix._21 = m_RightVector.y;
PlayerMatrix._31 = m_RightVector.z;
PlayerMatrix._12 = m_UpVector.x;
PlayerMatrix._22 = m_UpVector.y;
PlayerMatrix._32 = m_UpVector.z;
PlayerMatrix._13 = m_DirectionVector.x;
PlayerMatrix._23 = m_DirectionVector.y;
PlayerMatrix._33 = m_DirectionVector.z;
PlayerMatrix._14 = m_Position.x;
PlayerMatrix._24 = m_Position.y;
PlayerMatrix._34 = m_Position.z;
D3DXMatrixTranslation(&PlayerMatrix, _Point.x, _Point.y, _Point.z);
//D3DXMatrixTranslation(&PlayerMatrix, m_Position.x, m_Position.y, m_Position.z);
D3DXMatrixMultiply(&PlayerMatrix, &RotationMatrix, &PlayerMatrix);
//D3DXMatrixTranslation(&PlayerMatrix, _Point.x, _Point.y, _Point.z);
m_RightVector.x = PlayerMatrix._11;
m_RightVector.y = PlayerMatrix._21;
m_RightVector.z = PlayerMatrix._31;
m_UpVector.x = PlayerMatrix._12;
m_UpVector.y = PlayerMatrix._22;
m_UpVector.z = PlayerMatrix._32;
m_DirectionVector.x = PlayerMatrix._13;
m_DirectionVector.y = PlayerMatrix._23;
m_DirectionVector.z = PlayerMatrix._33;
m_Position.x = PlayerMatrix._14;
m_Position.x = PlayerMatrix._24;
m_Position.x = PlayerMatrix._34;
}
}