mirror of https://github.com/axmolengine/axmol.git
unify sensor timestamp units in Android / iOS / Tizen (#17532)
This commit is contained in:
parent
8a327c77fa
commit
1b46096b15
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue