Skip to content

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

Open
@rdoi

Description

@rdoi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions