psmove_get_magnetometer_vector() private method

private psmove_get_magnetometer_vector ( IntPtr move, float &mx, float &my, float &mz ) : void
move IntPtr
mx float
my float
mz float
return void
Exemplo n.º 1
0
    private static void ControllerUpdateSensors(
        IntPtr psmove, // PSMove*
        PSMoveRawControllerData_Base controllerData)
    {
        float acc_x = 0.0f, acc_y = 0.0f, acc_z = 0.0f;
        float gyro_x = 0.0f, gyro_y = 0.0f, gyro_z = 0.0f;
        float mag_x = 0.0f, mag_y = 0.0f, mag_z = 0.0f;

        PSMoveAPI.psmove_get_accelerometer_frame(psmove, PSMove_Frame.Frame_SecondHalf, ref acc_x, ref acc_y, ref acc_z);
        PSMoveAPI.psmove_get_gyroscope_frame(psmove, PSMove_Frame.Frame_SecondHalf, ref gyro_x, ref gyro_y, ref gyro_z);
        PSMoveAPI.psmove_get_magnetometer_vector(psmove, ref mag_x, ref mag_y, ref mag_z);

        controllerData.Accelerometer = new Vector3(acc_x, acc_y, acc_z);
        controllerData.Gyroscope     = new Vector3(gyro_x, gyro_y, gyro_z);
        controllerData.Magnetometer  = new Vector3(mag_x, mag_y, mag_z);
    }