away3d / away3d-core-fp10

Away3D engine for Flash Player 10
http://www.away3d.com
33 stars 11 forks source link

LookAt function forcing update even if no transformation occured #11

Open JonathanPaquinLafleur opened 12 years ago

JonathanPaquinLafleur commented 12 years ago

The function lookAt(target : Vector3D, upAxis : Vector3D = null) in Object3D should verify if the new matrix does some kind of transformation so that:

_rotationDirty = true; notifySceneTransformChange();

Does not get called even if no transformation has been applied.

The following condition was used in Away3D 3.4 which prevented this problem. if (_zAxis.modulo > 0.1 && (_zAxis.x != _transform.sxz || _zAxis.y != _transform.syz || _zAxis.z != _transform.szz)) { _xAxis.cross(_zAxis, upAxis || Number3D.UP);