Navigation


RSS : Articles / Comments


Simple Papervision HitTest Detection

1:28 PM, Posted by Jim Foley, 4 Comments

You might be making a game or a crazy nav piece that requires the use of hit detection. Papervision comes with a native HitTestObject method that allows you to easily detect if an object is intersecting another object.

//Usage...
mySphere.hitTestObject(myOtherSphere); //returns true or false

The concept is simple, if one objects bounding box intersects another objects bounding box, then the hitTestObject method will return true.

Example: click here
Flash Source: click here
Flex Source: click here

4 Comments

Barry Allen @ October 30, 2008 1:41 PM

How does this work with DAE files? I tried simply substituting the generated spheres with Collada objects but it broke.

Jim Foley @ October 31, 2008 8:38 AM

First thing to run across my brain is, did you swap the material with a materialsList object? and so on...

Anonymous @ April 4, 2009 4:03 PM

hey jim. i need some help with hittesting.. is there anyway we can find the exact point where hittest has taken place?

neca @ September 18, 2009 9:04 AM

Exact point of hitTest can be defined trough HitTestPoint(x,y,z)