tl;dr:
The target property of a MouseEvent3D should always point to the first ObjectContainer3D found that have mouseChildren=false in the capture phase.
From AS3 documentation on mouseChildren property:
"...This property is useful when you create a button with an instance of the Sprite class (instead of using the SimpleButton class). When you use a Sprite instance to create a button, you can choose to decorate the button by using the addChild() method to add additional Sprite instances. This process can cause unexpected behavior with mouse events because the Sprite instances you add as children can become the target object of a mouse event when you expect the parent instance to be the target object. To ensure that the parent instance serves as the target objects for mouse events, you can set the mouseChildren property of the parent instance to false..."
That's how it works in Stage and i think it should work the same way in Stage3D ( the properties have the same name and we can say ObjectContainer3D is a sort of Sprite)
So i'm expecting to use this property i.e. when i have an ObjectContainer3D that groups multiple children and i want to make it look like the events are dispatched from the ObjectContainer3D and not from the children of it.
EDIT: I think that should be changed "isIgnored(entity:Entity)" function (line 162) in RaycastPicker Class and not ignore entities that have _ancestorAllorMouseEnabled = false, later Mouse3DManager is already checking for _ancestorsAllowMouseEnabled and using parent if false( Line 137).
TESTED and working
FROM:
if (_onlyMouseEnabled && (!entity._ancestorsAllowMouseEnabled || !entity.mouseEnabled))
TO:
if (_onlyMouseEnabled && !entity.mouseEnabled)
Also Mouse3DManager needs a change at line 141 inside fireMouseEvents() function:
FROM:
for (i = 0; i < len; ++i) {
// Only dispatch from first implicitly enabled object ( one that is not a child of a mouseChildren = false hierarchy ).
event = _queuedEvents[i];
dispatcher = event.object;
while (dispatcher && !dispatcher._ancestorsAllowMouseEnabled)
dispatcher = dispatcher.parent;
if (dispatcher)
dispatcher.dispatchEvent(event);
}
TO:
for (i = 0; i < len; ++i) {
// Only dispatch from first implicitly enabled object ( one that is not a child of a mouseChildren = false hierarchy ).
event = _queuedEvents[i];
dispatcher = event.object;
while (dispatcher && !dispatcher._ancestorsAllowMouseEnabled)
{
dispatcher = dispatcher.parent;
event.object = dispatcher;
}
if (dispatcher)
dispatcher.dispatchEvent(event);
}
tl;dr: The target property of a MouseEvent3D should always point to the first ObjectContainer3D found that have mouseChildren=false in the capture phase.
From AS3 documentation on mouseChildren property:
"...This property is useful when you create a button with an instance of the Sprite class (instead of using the SimpleButton class). When you use a Sprite instance to create a button, you can choose to decorate the button by using the addChild() method to add additional Sprite instances. This process can cause unexpected behavior with mouse events because the Sprite instances you add as children can become the target object of a mouse event when you expect the parent instance to be the target object. To ensure that the parent instance serves as the target objects for mouse events, you can set the mouseChildren property of the parent instance to false..."
That's how it works in Stage and i think it should work the same way in Stage3D ( the properties have the same name and we can say ObjectContainer3D is a sort of Sprite)
So i'm expecting to use this property i.e. when i have an ObjectContainer3D that groups multiple children and i want to make it look like the events are dispatched from the ObjectContainer3D and not from the children of it.
EDIT: I think that should be changed "isIgnored(entity:Entity)" function (line 162) in RaycastPicker Class and not ignore entities that have _ancestorAllorMouseEnabled = false, later Mouse3DManager is already checking for _ancestorsAllowMouseEnabled and using parent if false( Line 137).
TESTED and working
Also Mouse3DManager needs a change at line 141 inside fireMouseEvents() function:
I hope it's clear what i mean.