vipnj / away3d

Automatically exported from code.google.com/p/away3d
0 stars 0 forks source link

HoverController.as wrapPanAngle Fix #195

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
"I'm sorry : 1) I'm french, 2) I don't know where to post this ..."

-> What steps will reproduce the problem?

1. Open Basic_Load3DS.as example project file
2. Add "cameraController.wrapPanAngle = true;" after line 151
3. Run the project and pan the camera

-> What is the expected output? What do you see instead?
After a 720° rotation on Y axe, the camera jump ...

-> What version of the product are you using? On what operating system?
Broomstick/fp11

->The Fix :

// away3d.controllers.HoverController.as, line 281 :

// Replace
if (panAngle - _currentPanAngle < -180)
    panAngle += 360;
else if (panAngle - _currentPanAngle > 180)
    panAngle -= 360;

// With
if (panAngle - _currentPanAngle < -180)
    _currentPanAngle -= 360;
else if (panAngle - _currentPanAngle > 180)
    _currentPanAngle += 360;

// Take care of switched operators "-=" and "+=".
// Thanks a lot to the away3d team !

Original issue reported on code.google.com by e.dauve on 20 May 2012 at 3:02