Вопрос

I've noticed that in several tutorials for using the rotation vector sensor, the mag and accel values are cloned prior to using them in getRotationMatrix.

For example, the code in the question here: Using getRotationMatrix and getOrientation in Android 2.1

However, getRotationMatrix doesn't change the mag and accel vectors. Therefore what is the point of cloning them? Thanks

Это было полезно?

Решение

I think they make that because onSensorChange can change their values (it uses the same variables), so they copy the values first.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top