away3d/away3d-core-fp11 — Issue #150: HitTestRenderer calling _context.present() in HitTestRenderer::update
Author: HashBandicoot
Created: 2011-10-11 21:03:24+00:00
State: open

I'm having an issue using MouseEvent3D. If ANY entity in my app has mouseEnabled set to true, my View3D render goes completely black. I tracked the code down to the last line of HitTestRenderer::update, the function _context.present() is being called.

If I do nothing to this line, my screen goes black on the first frame of rendering, although I get MouseEvent3D events as expected when moving the pointer around the screen.
If I comment out this line, everything works as I expect. I get MouseEvent3D events and my rendering is unaffected.

At the end of HitTestRenderer::update, the _hitRenderable member has already collected any MouseEvent3D hits. Why is the code calling .present() on _context?

I am not aware of any side effects of using Context3D, so I dont know if my code is conflicting with Away3D.
Here is the only snippet of code where I reference a Context3D object. I do not see any reason that this should conflict with me setting mouseEnabled on an Object3D added to the View3D. (I do see why setting mouseEnabled would cause the View3D to use the HitTestRenderer, because potentialFound is true, I do not see why the HitTestRenderer is calling .present after the hit test).

note: _viewGroundTiles and _viewAvatars are both View3D objects.

_viewGroundTiles.renderer.swapBackBuffer = false;
_viewGroundTiles.render();

var outputBmd:BitmapData = new BitmapData(_viewGroundTiles.width, _viewGroundTiles.height, true, 0x00FFFFFF);
_viewGroundTiles.renderer.context.drawToBitmapData(outputBmd);

_viewGroundTiles.renderer.swapBackBuffer = true;

_viewAvatars.backgroundImage = outputBmd;
_viewAvatars.render();