Mouse interactivity & entity bounds

Software: Away3D 4.x

Karim Beyrouti, Administrator
Posted: 15 March 2012 12:34 PM   Total Posts: 30

Wondering if mouse over/out/click 3d event hit detection uses the entity bounds to determine the hit area?

at the moment it does not seem like it, but maybe I am missing something.

Thanks


Karim

   

Karim Beyrouti, Administrator
Posted: 15 March 2012 02:06 PM   Total Posts: 30   [ # 1 ]

Looking at MouseRaycast - it seems that hit test detection should work with an entity’s bounds,

    ‘t = entity.bounds.intersectsRay( rp, rd );’

in my code - i am setting the bound to:

    mouseTarget.bounds.fromSphere(new Vector3D(), 1 );

however it does not seem to be using that to do hit detection. I have a demo here:

http://kurst.co.uk/samples/flightpaths/bounds_hit_test.html

which will probably run very slowly ( as it’s showing the bounds ), it shows mouse over/out in a textbox at the bottom right, and it’s clearly not using bounds for hit detection. Should it / is this a bug?

big thanks to all the away team for the wonderful work….

   

Karim Beyrouti, Administrator
Posted: 27 March 2012 05:34 PM   Total Posts: 30   [ # 2 ]

Please ignore - found the solution, for the archives there is a ‘mouseHitMethod’ on the mesh object :

amesh.mouseHitMethod = MouseHitMethod.BOUNDS_ONLY;

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X