Basically, you can’t access a sceneTtransform and set an unrelated object.transform within an 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’ve attached a full code for an example of this strange behaviour.
I speculate that it is caused by parallel access of statics consts like Matrix3DUtils.RAW_DATA_CONTAINER and others.
I understand that it optimizes the memory access avoiding constant memory allocation, but it may cause some weird problems when running in asynch codes.