unify sensor timestamp units in Android / iOS / Tizen (#17532)

This commit is contained in:
blackcruiser 2017-03-23 10:04:18 +08:00 committed by minggo
parent 8a327c77fa
commit 1b46096b15
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ extern "C" {
a.x = -((double)x / TG3_GRAVITY_EARTH);
a.y = -((double)y / TG3_GRAVITY_EARTH);
a.z = -((double)z / TG3_GRAVITY_EARTH);
a.timestamp = (double)timeStamp;
a.timestamp = (double)timeStamp / 1e9;
EventAcceleration event(a);
Director::getInstance()->getEventDispatcher()->dispatchEvent(&event);

View File

@ -78,7 +78,7 @@ static void accelerometer_sensor_cb(sensor_h _sensor, sensor_event_s *sensor_dat
_acceleration->x = sensor_data->values[0] / GRAVITY_EARTH;
_acceleration->y = sensor_data->values[1] / GRAVITY_EARTH;
_acceleration->z = sensor_data->values[2] / GRAVITY_EARTH;
_acceleration->timestamp = sensor_data->timestamp;
_acceleration->timestamp = (double)sensor_data->timestamp / 1e3;
double tmp = _acceleration->x;
Application *app = Application::getInstance();