psmove_get_accelerometer_frame() 개인적인 메소드

private psmove_get_accelerometer_frame ( IntPtr move, PSMove_Frame frame, float &ax, float &ay, float &az ) : void
move IntPtr
frame PSMove_Frame
ax float
ay float
az float
리턴 void
예제 #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);
    }