Package com.ardor3d.intersection

Examples of com.ardor3d.intersection.PickData


        if (current == previous || current.getDx() == 0 && current.getDy() == 0) {
            return;
        }

        // act on drag
        final PickData pickData = _results.getPickData(0);
        final Spatial picked = (Spatial) pickData.getTarget();
        if (picked instanceof Mesh && pickData.getIntersectionRecord().getNumberOfIntersections() > 0) {
            final PrimitiveKey key = pickData.getIntersectionRecord().getIntersectionPrimitive(0);
            ((Mesh) picked).getMeshData().getPrimitiveVertices(key.getPrimitiveIndex(), key.getSection(),
                    new Vector3[] { _calcVec3A, _calcVec3B, _calcVec3C });
            picked.localToWorld(_calcVec3A, _calcVec3A);
            picked.localToWorld(_calcVec3B, _calcVec3B);
            picked.localToWorld(_calcVec3C, _calcVec3C);
View Full Code Here


                if (_pickResults.getNumber() > 0) {
                    // picked something, show label.
                    _text.getSceneHints().setCullHint(CullHint.Never);

                    // set our text to the name of the ancestor of this object that is right under the _root node.
                    final PickData pick = _pickResults.getPickData(0);
                    if (pick.getTarget() instanceof Spatial) {
                        final Spatial topLevel = getTopLevel((Spatial) pick.getTarget());
                        if (!topLevel.equals(_picked)) {
                            clearPicked();
                            _picked = topLevel;
                            _picked.addController(_pickedControl);
                        }
View Full Code Here

        processPicks(pickResults);
        return pickResults;
    }

    protected void processPicks(final PrimitivePickResults pickResults) {
        final PickData pick = pickResults.findFirstIntersectingPickData();
        if (pick != null) {
            System.err.println("picked: " + pick.getTarget() + " at: "
                    + pick.getIntersectionRecord().getIntersectionPoint(0));
        } else {
            System.err.println("picked: nothing");
        }
    }
View Full Code Here

        while (pickResults.getNumber() > 0
                && pickResults.getPickData(i).getIntersectionRecord().getNumberOfIntersections() == 0
                && ++i < pickResults.getNumber()) {
        }
        if (pickResults.getNumber() > i) {
            final PickData pick = pickResults.getPickData(i);
            final int section = pick.getIntersectionRecord().getIntersectionPrimitive(0).getSection();
            if (pick.getTarget() instanceof Mesh) {
                final Mesh hit = (Mesh) pick.getTarget();
                System.err.println("picked: " + hit + " section: " + section + " (type = "
                        + hit.getMeshData().getIndexMode(section) + ") primitive: "
                        + pick.getIntersectionRecord().getIntersectionPrimitive(0).getPrimitiveIndex());
            }
        } else {
            System.err.println("picked: nothing");
        }
    }
View Full Code Here

        manager.addFilter(new PlaneBoundaryFilter(new Plane(Vector3.UNIT_Y, 0)));
    }

    @Override
    protected void processPicks(final PrimitivePickResults pickResults) {
        final PickData pick = pickResults.findFirstIntersectingPickData();
        if (pick != null) {
            final Pickable target = pick.getTarget();
            if (target instanceof Spatial) {
                manager.setSpatialTarget(((Spatial) target).getParent());
                return;
            }
        }
View Full Code Here

TOP

Related Classes of com.ardor3d.intersection.PickData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.