Hi,

I am seeing occasional erratic behaviour from Locale.pickAll().

Each frame, I construct a PickSegment which points forward from the
viewpoint in order that I can test to see if the viewpoint is going to hit anything
in my scene when it moves forward.

This works about 99% of the time, but once in a while, the 'pickAll()' returns
an array of SceneGraphPaths with over 3500 elements ! This seems pretty
strange given that

a) The viewpoint is moving forward very slowly, and is thus my PickSegment's
length is typically quite short

b) Although I have quite a lot of geometry, I'm pretty sure I don't have anything like
3500 Shape3D's in my scene ( I haven't yet workd out an easy way
to count how many Shape3D's are in my scene, but the ones I do havbe are certainly not
collinear.

This gives a huge stutter (~ 3 seconds) in my rendering as I then test each of the Shape3D's.

Is this a bug, or am I doing something wrong. I can supply a runnable jar file with source
included if anyone is interested.

A piece of my code is included below. The output looks like:

0 : null
0 : null
0 : null
0 : null
0 : null
0 : null
0 : null
10 : null
0 : null
0 : null
0 : null
0 : null
260 : 3759
0 : null
0 : null
0 : null
0 : null
0 : null
0 : null

Thanks

Rob

      PickSegment ps = new PickSegment(pickStart,pickEnd);

        long lll = System.currentTimeMillis();
        SceneGraphPath sgpa[] = sc.pickAll(ps);
        long xxx = System.currentTimeMillis() - lll;
        System.out.print(xxx + " : ");
        if (sgpa != null)
        {
            System.out.println(sgpa.length);
        }
        else
        {
            System.out.println("null");
        }

--
 

Rob Nugent
Development Manager
PeerLogic
[EMAIL PROTECTED]
http://www.peerlogic.com
Tel: +44 (0) 1489 585503
Fax: +44 (0) 1489 881363
 

Reply via email to