#pragma once #include /*! \file acceleration.h \brief Provides data provided by acceleration-sensors. */ #ifdef __cplusplus extern "C" { #endif /// /// Sets the acceleration-callback which is called with measured acceleration-data in three dimensions. /// /// The callback KINC_FUNC void kinc_acceleration_set_callback(void (*value)(float /*x*/, float /*y*/, float /*z*/)); void kinc_internal_on_acceleration(float x, float y, float z); #ifdef KINC_IMPLEMENTATION_INPUT #define KINC_IMPLEMENTATION #endif #ifdef KINC_IMPLEMENTATION #include void (*acceleration_callback)(float /*x*/, float /*y*/, float /*z*/) = NULL; void kinc_acceleration_set_callback(void (*value)(float /*x*/, float /*y*/, float /*z*/)) { acceleration_callback = value; } void kinc_internal_on_acceleration(float x, float y, float z) { if (acceleration_callback != NULL) { acceleration_callback(x, y, z); } } #endif #ifdef __cplusplus } #endif