Search in sources :

Example 6 with PickResult

use of com.sun.j3d.utils.picking.PickResult in project ffx by mjschnie.

the class PickTranslateBehavior method updateScene.

/*
     * Update the scene to manipulate any nodes. This is not meant to be called
     * by users. Behavior automatically calls this. You can call this only if
     * you know what you are doing.
     * @param xpos Current mouse X pos. @param ypos Current mouse Y pos.
     */
/**
 * {@inheritDoc}
 */
public void updateScene(int xpos, int ypos) {
    if ((mevent.getModifiersEx() & MouseEvent.BUTTON3_DOWN_MASK) == MouseEvent.BUTTON3_DOWN_MASK) {
        pickCanvas.setShapeLocation(xpos, ypos);
        PickResult r = pickCanvas.pickClosest();
        if (r != null) {
            if (callback != null) {
                callback.transformChanged(PickingCallback.NO_PICK, null);
            }
        }
    }
}
Also used : PickResult(com.sun.j3d.utils.picking.PickResult)

Aggregations

PickResult (com.sun.j3d.utils.picking.PickResult)6 TransformGroup (javax.media.j3d.TransformGroup)4 PickIntersection (com.sun.j3d.utils.picking.PickIntersection)1 MolecularAssembly (ffx.potential.MolecularAssembly)1 Atom (ffx.potential.bonded.Atom)1 MSNode (ffx.potential.bonded.MSNode)1 Molecule (ffx.potential.bonded.Molecule)1 Polymer (ffx.potential.bonded.Polymer)1 ArrayList (java.util.ArrayList)1 Node (javax.media.j3d.Node)1 SceneGraphPath (javax.media.j3d.SceneGraphPath)1 Shape3D (javax.media.j3d.Shape3D)1