Re: Some comments about DeviceOrientation draft

> Other than that I'm not sure if combining accelerometer and rotation sensor
> into one dom event is a best thing to do either. These events are typically
> sent separately by the platform so the user agent implementation would have
> to somehow cache these events and then send them to javascript when it has
> both acceleration and rotation data. This will mean that at least result of
> one sensor might be late. While the time differences might be minuscule,
> they might matter. Wouldn't it be better if there were 2 separate events for
> rotation and accelerometer?
The idea is to make it as easy as possible for JavaScript developers
to process this data. The DeviceMotion event is intended for more
sophisticated applications than simply determining which way a device
is pointing. By making sure that data is provided at a regular
interval, and that rotation and acceleration data are provided
together, we make it as easy as possible for the JavaScript developer
to process the data.

> The last issue is rather cosmetical: why do we need to have 2 separate
> properties for acceleration : acceleration and accelerationIncludingGravity?
> Wouldn't it be better to just have additional field includesGravity in
> Acceleration interface.
I think we chose this approach as a convenience for JavaScript
developers. Devices that are able to account for the effects of
gravity will be able to provide data for both 'acceleration' and
'accelerationIncludingGravity' and this could be useful. If we switch
to using 'acceleration' and an 'includesGravity' flag, developers
would have to calculate 'accelerationIncludingGravity' from
'acceleration' using the device's orientation. I don't feel strongly
about which is better, so would be happy to change it if others feel
the same way.

Steve

-- 
Google UK Limited
Registered Office: Belgrave House, 76 Buckingham Palace Road, London SW1W 9TQ
Registered in England Number: 3977902

Received on Friday, 18 February 2011 16:33:43 UTC