ywywdh / papervision3d

Automatically exported from code.google.com/p/papervision3d
0 stars 0 forks source link

Retrieve do3d property to flex ui component causes error on interactive event #288

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. create an application:

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx"
               creationComplete="application1_creationCompleteHandler(event)"
               minWidth="955" minHeight="600">
    <fx:Script>
        <![CDATA[
            import mx.controls.Alert;
            import mx.events.FlexEvent;

            import org.papervision3d.cameras.Camera3D;
            import org.papervision3d.core.proto.MaterialObject3D;
            import org.papervision3d.core.utils.Mouse3D;
            import org.papervision3d.events.InteractiveScene3DEvent;
            import org.papervision3d.materials.ColorMaterial;
            import org.papervision3d.objects.primitives.Plane;
            import org.papervision3d.render.BasicRenderEngine;
            import org.papervision3d.scenes.Scene3D;
            import org.papervision3d.view.Viewport3D;

            protected var viewport:Viewport3D;
            protected var scene:Scene3D;
            protected var camera:Camera3D;
            protected var renderer:BasicRenderEngine;

            protected function application1_creationCompleteHandler(event:FlexEvent):void
            {
                viewport = new Viewport3D(640,480,true,true);
                scene = new Scene3D();
                camera = new Camera3D();
                renderer = new BasicRenderEngine();
                Mouse3D.enabled = true;

                var material:ColorMaterial = new ColorMaterial(new Number('0x000000'));
                material.interactive = true;
                var plane:Plane = new Plane(material,500,500);
                plane.name = 'myPlane';
                plane.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, objectPressHandler);
                scene.addChild(plane);
                sceneComponent.addChild(viewport);

                this.addEventListener(Event.ENTER_FRAME, enterFrameHandler); 
            }

            protected function enterFrameHandler(event:Event):void
            {
                renderer.renderScene(scene, camera, viewport);
            }

            protected function objectPressHandler(event:InteractiveScene3DEvent):void
            {
                trace('name: '+event.displayObject3D.name); // is ok
                Alert.show('pressed: '+event.displayObject3D.name); // is error
                //log.text += event.displayObject3D.name + "\n"; // is error
            }

        ]]>
    </fx:Script>
    <mx:UIComponent id="sceneComponent" width="100%" height="100%"/>
    <mx:TextArea id="log" text="log" width="100" height="20" />
</s:Application>

What is the expected output? What do you see instead?
Show object properties in alert or log to textArea mx control.

What version of the product are you using? On what operating system?
OS: Ubuntu 12.04
INFO: Papervision3D 2.1 rev920 (August 11th, 2009)

Please provide any additional information below.
This same was occured with BasicView and singleRender.

Log:
INFO: Papervision3D 2.1 rev920 (August 11th, 2009)

INFO: Viewport autoScaleToStage : Papervision has changed the Stage scale mode. 
name: myPlane
Error: Error #1023: Stack overflow occurred.
    at InteractiveApp/objectPressHandler()[/home/tom/Development/WORKSPACE/PV_Client/src/InteractiveApp.mxml:55]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.papervision3d.core.utils::InteractiveSceneManager/dispatchObjectEvent()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/InteractiveSceneManager.as:339]
    at org.papervision3d.core.utils::InteractiveSceneManager/handleMousePress()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/InteractiveSceneManager.as:192]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.managers::SystemManager/mouseEventHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\SystemManager.as:2924]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.papervision3d.core.utils.virtualmouse::VirtualMouse/handleUpdate()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/virtualmouse/VirtualMouse.as:724]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.papervision3d.core.utils.virtualmouse::VirtualMouse/update()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/virtualmouse/VirtualMouse.as:562]
    at org.papervision3d.core.utils.virtualmouse::VirtualMouse/press()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/virtualmouse/VirtualMouse.as:451]
    at org.papervision3d.core.utils::InteractiveSceneManager/handleMousePress()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/InteractiveSceneManager.as:189]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.managers::SystemManager/mouseEventHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\SystemManager.as:2924]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.papervision3d.core.utils.virtualmouse::VirtualMouse/handleUpdate()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/virtualmouse/VirtualMouse.as:724]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.papervision3d.core.utils.virtualmouse::VirtualMouse/update()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/virtualmouse/VirtualMouse.as:562]
    at org.papervision3d.core.utils.virtualmouse::VirtualMouse/press()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/virtualmouse/VirtualMouse.as:451]
    at org.papervision3d.core.utils::InteractiveSceneManager/handleMousePress()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/InteractiveSceneManager.as:189]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.managers::SystemManager/mouseEventHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\SystemManager.as:2924]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.papervision3d.core.utils.virtualmouse::VirtualMouse/handleUpdate()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/virtualmouse/VirtualMouse.as:724]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.papervision3d.core.utils.virtualmouse::VirtualMouse/update()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/virtualmouse/VirtualMouse.as:562]
    at org.papervision3d.core.utils.virtualmouse::VirtualMouse/press()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/virtualmouse/VirtualMouse.as:451]
    at org.papervision3d.core.utils::InteractiveSceneManager/handleMousePress()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/InteractiveSceneManager.as:189]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.managers::SystemManager/mouseEventHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\SystemManager.as:2924]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.papervision3d.core.utils.virtualmouse::VirtualMouse/handleUpdate()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/virtualmouse/VirtualMouse.as:724]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.papervision3d.core.utils.virtualmouse::VirtualMouse/update()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/virtualmouse/VirtualMouse.as:562]
    at org.papervision3d.core.utils.virtualmouse::VirtualMouse/press()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/virtualmouse/VirtualMouse.as:451]
    at org.papervision3d.core.utils::InteractiveSceneManager/handleMousePress()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/InteractiveSceneManager.as:189]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.managers::SystemManager/mouseEventHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\SystemManager.as:2924]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.papervision3d.core.utils.virtualmouse::VirtualMouse/handleUpdate()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/virtualmouse/VirtualMouse.as:724]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.papervision3d.core.utils.virtualmouse::VirtualMouse/update()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/virtualmouse/VirtualMouse.as:562]
    at org.papervision3d.core.utils.virtualmouse::VirtualMouse/press()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/virtualmouse/VirtualMouse.as:451]
    at org.papervision3d.core.utils::InteractiveSceneManager/handleMousePress()[/home/tom/Development/WORKSPACE/PV_Client/src/org/papervision3d/core/utils/InteractiveSceneManager.as:189]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at mx.managers::SystemManager/mouseEventHandler()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\SystemManager.as:2924]
    at flash.events::EventDispatcher/dispatchEventFunction()

Original issue reported on code.google.com by t.sad...@gmail.com on 28 Sep 2012 at 6:46