/** * Get the current acceleration values from the device * * @return the acceleration or null if the device is closed */ public synchronized KinectAcceleration getAcceleration() { if (device == null) return null; final Pointer<Double> px = Pointer.pointerToDouble(0); final Pointer<Double> py = Pointer.pointerToDouble(0); final Pointer<Double> pz = Pointer.pointerToDouble(0); libfreenectLibrary.freenect_update_tilt_state(device); final Pointer<freenect_raw_tilt_state> state = libfreenectLibrary.freenect_get_tilt_state(device); libfreenectLibrary.freenect_get_mks_accel(state, px, py, pz); return new KinectAcceleration(px.getDouble(), py.getDouble(), pz.getDouble()); }
/** * Get the current acceleration values from the device * * @return the acceleration or null if the device is closed */ public synchronized KinectAcceleration getAcceleration() { if (device == null) return null; final Pointer<Double> px = Pointer.pointerToDouble(0); final Pointer<Double> py = Pointer.pointerToDouble(0); final Pointer<Double> pz = Pointer.pointerToDouble(0); libfreenectLibrary.freenect_update_tilt_state(device); final Pointer<freenect_raw_tilt_state> state = libfreenectLibrary.freenect_get_tilt_state(device); libfreenectLibrary.freenect_get_mks_accel(state, px, py, pz); return new KinectAcceleration(px.getDouble(), py.getDouble(), pz.getDouble()); }