Skip to main content

Pick a TransformGroup or Group

1 reply [Last post]
jarodrussell
Offline
Joined: 2010-05-19
Points: 0

I have this:

<br />
public class Circle extends LineStripArray {<br />
           //draw a circle<br />
}</p>
<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>
<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 />
pc.setTolerance(1.0f);</p>
<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.
lyfox
Offline
Joined: 2010-08-17
Points: 0

Extend RingGroup from Shape3D, maybe?