google-code-export / papervision3d

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

Listening for mouse events give NPE when enabling Touch #273

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Add a mouse event listener to a viewport (In my case an 
MouseEvent.MOUSE_DOWN)
2. Enable touch-screen listening: Multitouch.inputMode = 
MultitouchInputMode.NONE // makes touch show up as mouse events
3. Use the touch screen

What is the expected output? What do you see instead?
At first it works as expected, but i get a null pointer exception after using 
it for 10-20 seconds. Not been able to find out if it is a special "gesture" 
that triggers the problem.

What version of the product are you using? On what operating system?
Papervision 2.1.932 on Windows 7 and on OS X Snow Leopard 

Please provide any additional information below.
I tracked down the NPE to line 339 in 
org.papervision3d.core.utils.InteractiveSceneManager. 
In the current version is says: 
DO3D.dispatchEvent(ev);

By changing this to
if(DO3D) DO3D.dispatchEvent(ev);

the problem disappears. Im not sure if this causes any side effects, but 
further down on line 343 I found:

if( DO3D ) DO3D.dispatchEvent(new InteractiveScene3DEvent(event, DO3D, 
container));

so it seems reasonable that we should check for null-pointer in both cases.

Original issue reported on code.google.com by erikaxel...@gmail.com on 3 Sep 2010 at 9:51