camerapick bug in iminib3d

BlitzMax Forums/MiniB3D Module/camerapick bug in iminib3d

jhocking(Posted 2010) [#1]
I'm working on a project using iminib3d, and for the past couple hours I've been banging my head against a subtle problem I'm having with CameraPick. I've got several sprites attached to the camera that have their pickmode set, and then the ground of the scene is also pickable.

When the camera is still, objects obscure each other properly. Specifically, when tapping on the GUI buttons the ground is not picked.

However after the camera moves, the ground gets picked along with the GUI buttons. The problem isn't just when picking while the camera is moving, it happens even while the camera is still after having moved. I've been trying for a while to figure out what I could be doing wrong, so I'm suspecting this is a bug in iminib3d.

Can anything think of a way to fix this issue?


simonh(Posted 2010) [#2]
There is a bug in 0.3 that means the first CameraPick doesn't work. I'm not sure if this would account for your problem however.

I'll try and release 0.4 as soon as possible, but also feel free to send me the project if you want and I'll take a look.


jhocking(Posted 2010) [#3]
Thanks, I might send you my project tonight to take a look at.

I've also noticed that when I move a sprite to the picked location (I put in a sprite to show where the player tapped,) the sprite is way off for one frame before snapping to the correct place.

This wrong pick location isn't only when tapping on the GUI buttons, it's any tap whatsoever. Even when tapping directly on the ground, the target sprite briefly flickers in the wrong place before snapping to the correct location.

This behavior gives an important clue into what's going on. It makes me think of a possible workaround to the bug, and hopefully gives you some insight into what's going on.


SLotman(Posted 2010) [#4]
does this solves your problem?

At least here, the camerapick sample that comes with miniB3D is working :)


jhocking(Posted 2010) [#5]
Thanks for the link, but that doesn't seem to have anything to do with this. My problem is in iminib3d, not minib3d.

Anyway this comment by simon indicated a workaround:
the first CameraPick doesn't work.


So the problem is that the first CameraPick after the camera moves is always off. A workaround is to call an extra CameraPick immediately after moving the camera. That is kinda wasteful of course, calling an unnecessary extra camera pick every frame.


jhocking(Posted 2010) [#6]
just an fyi for anyone stumbling on this thread, simon fixed this bug in iminib3d 0.4