Better rollovers in PaperVision3D

I found a little perculiarity in the latest release of PaperVision3D today, and came up with a fix, so I thought I'd post it. The way it currently works, rollovers and rollouts may not be detected if you have a moving camera (which I normally do - hey it looks cooler!).

To fix, all you need to do is open org.papervision3d.core.utils.InteractiveSceneManager and delete or comment out line 236 if ( hasMouseMoved() ) in the handleMouseOver function and line 247 if( !hasMouseMoved() ) return; in the handleMouseOut function.

Now you will get nice responsive mouse events even if you have a nice drifty camera. I have tipped off Seb from the PV3D via twitter so I think those clever people are going to look into it.

By the way, if you haven't tried combining PaperVision3D with TweenMax, I highly recomend you do! I've had some freakin' incredible results that I wish I could post (but I can't).

Comments

Seb Lee-Delisle said…
Hi Iain,

yeah I'm pretty sure that this was one of my "optimisations"! I found that the processor was going mental checking every single triangle even when the mouse wasn't moving. Of course I didn't realise that the objects or the camera could be moving instead. My bad. I'll fix it. Thanks for the heads up!

Seb
Stelios said…
Man you' re a genius!
It worked like a charm. I've been banging my head to the wall for days now! Thanks a million!

The only thing is that line 236, has the if statement AND the dispatchEvent so if I comment out the entire line, no RollOvers occur. I tried separating that one line into two, like this:

//if( hasMouseMoved() )
dispatchObjectEvent(InteractiveScene3DEvent.OBJECT_OVER, DO3D);

Once again, thank you!!!