Skip to main content

Pick a TransformGroup or Group

1 reply [Last post]
Joined: 2010-05-19

I have this:

<br />
public class Circle extends LineStripArray {<br />
           //draw a circle<br />
<p>public class Ring extends Shape3D{<br />
           private Circle c;</p>
<p>           public Ring(...){<br />
                      //create the circle and at it to the shape;<br />
           }<br />
<p>public class RingGroup extends Group {<br />
           private Ring r1, r2, r3;</p>
<p>           public RingGroup(...){<br />
                     //create and add the Rings to the RingGroup, do other stuff;<br />
           }<br />
}<br />

Now I tried to pick them.

<br />
PickCanvas pc = new PickCanvas(canvas, branchGroup);<br />
pc.setMode(PickCanvas.GEOMETRY);<br />
<p>pc.setShapeLocation(e);<br />
PickResult[ ] results = pickCanvas.pickAllSorted();<br />
//...<br />
Node pickedNode = results[i].getNode(PickResult.GROUP);<br />

But the PickResult is always one of the Ring objects. The pickedNode Node is always null. What do I need to do to return the whole RingGroup object?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2010-08-17

Extend RingGroup from Shape3D, maybe?