3D Picking

From Director Online Wiki
Jump to: navigation, search

ModelsUnderRay

Here's a tip from Nick Kang to speed up ModelsUnderRay:

"For some reason, ray tests directly along the coordinate axes are much slower than tests oblique to the axes. I've measured a 50% drop in complex scenes. For example, a typical ground test (where +y = up):

Slow: modelsUnderRay(startPosition, vector(0,-1,0), 1 , #DETAILED)

Fast: modelsUnderRay(startPosition, vector(0.0001, -0.9999, 0.0001), 1 , #DETAILED)"