Mouse Interaction - new F11 Beta framework

Software: Away3D 4.x

Avatar
theMightyAtom, Sr. Member
Posted: 15 July 2011 06:19 AM   Total Posts: 669

Something in the new framework is preventing mouse interaction with ordinary Sprite objects on the stage.

http://videometry.net/broomstick/shirt/shirtExample.html
This example uses a transparent layer over the 3D Window to catch mouse events.

Not knowing there was a new framework, I did a small hack on the old one and mouse interaction was not affected, so that tells me it’s something in the Away3D F11 framework, rather than the player beta itself.

http://videometry.net/broomstick/shirt.html
(compiled for new F11 beta player, using old framework)

I have another project (which unfortunately I can’t share yet) where I seem to get every third mouse event when using the new framework, whilst an ordinary menu on the stage no longer gets any mouse events!

Apart from changing the stage3D.viewPort, what else has changed that might be causing this?

On the plus side, (and possibly related?) mouse events within the 3D scene suddenly started working after DerSchmale’s last fix (“Bad input size”).
http://videometry.net/broomstick/RealtimeDeformation.html

Totally baffled,

Pete

   

ragaes, Newbie
Posted: 15 July 2011 09:03 AM   Total Posts: 4   [ # 1 ]

The mouse hit detection doesn’t work for me yet.

With the last push to the src repository the “Bad input size” problem was solved, but the hit detection doesn’t seem to work properly as it gives me always the same object (renderable), whereever I click on the screen…

By the way, while revisiting the code in order to find the cause of the problem I’ve found what seems to be bugs related to the mouse hit detection, however, these are not related to this problem:

1.- Mouse3DManager.as, line 148:

Instead of:
_hitTestRenderer.update((_view.mouseX-_view.x)/_view.width, (_view.mouseY-_view.y)/_view.height, collector);

It should be:
_hitTestRenderer.update(_view.mouseX /_view.width, _view.mouseY /_view.height, collector);

Because _view.mouseX and _view.mouseY are already in _view coordinates.

2.- View3D.as:
Whenever you do viewPortX = _x or viewPortY = _y on _hitTestRenderer or _renderer objects you should first convert _x and _y to Global coordinates.

This is because _x and _y are in View3D parent’s coordinates and viewPortX and viewPortY are in stage (global) coordinates.

You should do this:
var pt : Point = this.parent.localToGlobal(new Point(_x, _y));

If you try to insert the View3D in the Stage with an offset you will find that things doen’t work as expected.

3.- Entity.as, line 177:
This is not related to the mouse hit detection, but anyway:

You should check that mvpIndex is greater than 0 before decrementing it.

I don’t know why, but in certain cases _mvpIndex decreases below 0 and the programs crashes at some point.

public function popModelViewProjection() : void
{
      if(_mvpIndex > 0)—_mvpIndex;
}

Hope this helps.

   

Avatar
Rob Bateman, Administrator
Posted: 15 July 2011 11:06 AM   Total Posts: 120   [ # 2 ]

This bug is being looked at right now, will update you here when a fix has been made

cheers for the info!

   

cameraMan, Newbie
Posted: 15 July 2011 11:35 AM   Total Posts: 3   [ # 3 ]

This is a workaround for View3D positioning - till they fix it

I found that there are 4 stage3D and I managed to change the View3D position by changing all the 4 stage3D x or y values (stage.stage3Ds[0].x, stage.stage3Ds[1].x etc)


PS. gongratulations for everything away3d people

   

Avatar
theMightyAtom, Sr. Member
Posted: 15 July 2011 03:31 PM   Total Posts: 669   [ # 4 ]

That should resolve stage position, but I still don’t get how MouseEvents in the overlying Flash layer are being blocked.
Is everyone else experiencing the same thing?

I can provide samples for the team if it’s of any help.

   

Avatar
David Lenaerts, Administrator
Posted: 15 July 2011 03:45 PM   Total Posts: 80   [ # 5 ]

Peter: I’m a bit confused with the issue, are you saying that anything placed on top of the View3D doesn’t receive mouse events? I couldn’t reproduce this, can you check with the latest updates and if it still doesn’t work, send me an example?

Ragaes: I’ve replied to the issues you submitted on Github already. The mouse interaction issues should be fixed now if you update. Let me know if there’s still any problems!

EDIT: Forgot to mention, the fix you suggested for Entity has not been fixed, since it’s not the root cause of the problem and would be covering up another bug. Would be cool to get an example that can reproduce the bug!

   

Avatar
theMightyAtom, Sr. Member
Posted: 16 July 2011 07:31 AM   Total Posts: 669   [ # 6 ]

Hi David. It’s the same I’m afraid. Works against Broomstick, with modified Stage3DProxy, but not against the new framework. I’m surprised no-one else is reporting this as it’s an issue in just about all my projects.

I will send an example to you.

Cheers,

Pete

   

Avatar
theMightyAtom, Sr. Member
Posted: 16 July 2011 08:11 AM   Total Posts: 669   [ # 7 ]

Example sent to your gmail smile

   

Avatar
Jeff, Newbie
Posted: 16 July 2011 10:26 AM   Total Posts: 30   [ # 8 ]

Hi all,

On main class, If object are added to the display list by using addChild(.. ), the objects are visible but mouse events attached on them do not work.

stage.addChild(...) solve the problem.

This is maybe your issue Peter

Regards,

Jeff

   

Avatar
theMightyAtom, Sr. Member
Posted: 16 July 2011 03:59 PM   Total Posts: 669   [ # 9 ]

Interesting Jeff, will try that out.
But it must be an issue with the new framework or the OSMF that is required with the new framework. Worth resolving, as addChild is normal practice and would make many classes fail when used in conjunction with Away.

   

Avatar
David Lenaerts, Administrator
Posted: 17 July 2011 06:25 PM   Total Posts: 80   [ # 10 ]

Hey Peter,

The issue is that your View3D instance is placed on top of your UI elements, so the hitfield required to register interaction listeners is covering up your existing content. addChildAt(view, 0) should fix things!

Cheers,
David

   

Avatar
theMightyAtom, Sr. Member
Posted: 18 July 2011 04:05 PM   Total Posts: 669   [ # 11 ]

Thanks David, I really appreciate that.

Was there a reason for moving away from stage listeners?

I ask because I changed Mouse3DManager.as back to using stage listeners as it did in Broomstick, instead of mouse hits to the invisible “_hitField” in View3D, and 3D mouse events work perfectly, without Away3D adding anything to the Flash display list which might trip up developers like me grin

addChildAt(view,0) is an OK workaround, providing you don’t have other display list managers in your project, but why not avoid this possible issue altogether?

Just asking! wink

   

Avatar
David Lenaerts, Administrator
Posted: 20 July 2011 11:39 AM   Total Posts: 80   [ # 12 ]

If I remember correctly, it was because unwanted mouse events were occurring due to bubbling, when overlayed UI elements were triggered.

   

ricovitch, Newbie
Posted: 03 August 2011 07:44 PM   Total Posts: 22   [ # 13 ]

Hi,

With the latests git repo modifications, i can’t seem to get anymore mouseover/mouseout (3d) events to fire.

My view3d instance is placed first on stage, then everything is added on top.
It worked well till the last two days updates.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X