Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behavior when calling unrelated transform within a camera event #713

Open
rdoi opened this issue Jan 22, 2015 · 0 comments
Open

Comments

@rdoi
Copy link

rdoi commented Jan 22, 2015

Just a transcript of an old bug I've reported on Away3D forum a couple of months ago:
http://away3d.com/forum/viewthread/5422/

Basically, you can’t access a sceneTransform and set an unrelated object.transform within an camera event.

  private function initCameraListener() : void {
   view.camera.addEventListener(Object3DEvent.SCENETRANSFORM_CHANGED, onCameraChange);
  }

  private function onCameraChange(event : Object3DEvent) : void {
   const camera : Camera3D = (event.target as Camera3D);
   const obj : Object3D = new Object3D();

   // ********************************************************
   // Does nothing, purposely. Just to force a getter call.
   camera.sceneTransform;

   // This affects the camera hover!
   // Comment out this line, or the above one to get the expected result
   obj.transform = new Matrix3D();
   // ********************************************************
  }

I speculate that it is caused by parallel access of statics consts like Matrix3DUtils.RAW_DATA_CONTAINER and others.

Test project here:
http://away3d.com/?ACT=26&fid=47&aid=1831_NeipTW1iRuCzsTtVM5rM&board_id=1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant