本部分仅适用于 Windows 7 及更高版本的作系统。
以下代码演示如何将XR_BIAS转换为 float:
float XRtoFloat( UINT XRComponent ) {
// The & 0x3ff shows that only 10 bits contribute to the conversion.
return (float)( (XRComponent & 0x3ff) - 0x180 ) / 510.f;
}
本部分仅适用于 Windows 7 及更高版本的作系统。
以下代码演示如何将XR_BIAS转换为 float:
float XRtoFloat( UINT XRComponent ) {
// The & 0x3ff shows that only 10 bits contribute to the conversion.
return (float)( (XRComponent & 0x3ff) - 0x180 ) / 510.f;
}