away3d/away3d-core-fp11 — Issue #207: sceneTransform bug when accessed inside a Object3DEvent.SCENETRANSFORM_CHANGED
Author: RVillani
Created: 2012-02-03 04:44:33+00:00
State: open

All objects related to an object wich has the sceneTransform property accessed inside a Object3DEvent.SCENETRANSFORM_CHANGED listener function loose their visual transformation and you see them rendered as it had no transform at all.

To reproduce, try making an object rotate 1 degree on EnterFrame and listening to its Object3DEvent.SCENETRANSFORM_CHANGED. Inside the listener function access the sceneTransform property of the same object and voila! Bugged.

I tried to solve myself, but I gave up after hours trying to change things related to the invalidateSceneTransform and updateSceneTransform functions. I leave it up to you guys. Since you're awesome, I'm sure you can figure it out real quick! =)

Sample code to reproduce bug:

addEventListener(Event.ENTER_FRAME, onFrame);
objCont3D.addEventListener(Object3DEvent.SCENETRANSFORM_CHANGED, onTransformChanged);

private function onFrame(event:Event):void {
objCont3D.rotationY += 2;
}

private function onTransformChanged(event:Object3DEvent):void {
objCont3D.sceneTransform; // just trying to access the property triggers the bug already
}