away3d / away3d-core-fp11

Away3D engine for Flash Player 11
http://www.away3d.com
Other
640 stars 273 forks source link

Any maths involving Camera matrix causes HoverController to do something strange #715

Open bknill opened 9 years ago

bknill commented 9 years ago

Hi,

I've reported this on the forum but as there's no support I'm assuming it's a bug. It might be related to #713

I'm updating the camera with a device motion Quaternion

            camera.transform = q.toMatrix3D();

I'm then attempting to get Pan and Tilt values from this Quaternion, so when it switches back to hoverController on touch, it's facing the same way

As soon as I do any maths on this Quaternion (doesn't actually matter what Maths is involved)

                            _currentPan = q.toEulerAngles(Vector3D.Y_AXIS).z * 180/Math.PI;
            _currentTilt = q.toEulerAngles(Vector3D.Z_AXIS).x * 180/Math.PI;

When the hoverController is enabled, the view is flipped upside down and to a strange angle.