ahlekoofe / gamekit

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

After changing to primary scene, mouse (touch) sensors stop working correctly on android #242

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Click on first cube
2. Click on second cube to return to first
3. Now click somewhere off the cube, it will trigger sensors as if you clicked 
on the cube.

Problem is, i want to change scenes when i click an object. Changing scenes 
works fine, but the touch events don't work correctly anymore. I've added a 
sample blend file with the scenes. 

It works fine on gamekit in blender. It also works fine on first and second 
scene. Maybe the problem is when you return to a scene you were once on. Ok 
just tested that too, and yes, changing back to previous scene makes sensors 
buggy.

Windows 7, Blender 2.54 with Gamekit addon (from trunk), on Samsung Galaxy 
Nexus, Android 4.0.2.

LogCat also shows an error setting viewport, attached log of some lines.

Original issue reported on code.google.com by matic.o...@gmail.com on 3 Jul 2012 at 9:45

Attachments:

GoogleCodeExporter commented 8 years ago
Indeed this is a bug. I will dig into this

Original comment by thomas.t...@googlemail.com on 4 Jul 2012 at 2:07

GoogleCodeExporter commented 8 years ago
Ok, I fixed it! The problem was that somehow the last result was cached due to 
some optimizations and was only refresehd on mouse-move. but since the 
button-pressed seems to be faster recognized than the movement the sensor took 
the last result again (which was true).
Since this optimization is not working at all (cause it would fail for moving 
objects that would move under the cursor) I removed it completely but added 
that mobile device only do the pickray only if the display is touched and not 
all the time like on the desktop.

This is the commit:
http://code.google.com/p/gamekit/source/detail?r=1105

About the viewport error. Actually I'm not sure about this anymore. There are 
some problems with ogre and the viewport and I had to hack to get it work. 
Ignore the error. I hope once we update ogre again this will be also fixed.

Thx, for reporting with the useful sample.

Original comment by thomas.t...@googlemail.com on 4 Jul 2012 at 5:04