Package com.ardor3d.scenegraph

Examples of com.ardor3d.scenegraph.Spatial


    @Override
    public void targetChanged(final InteractManager manager) {
        if (_dragging) {
            endDrag(manager);
        }
        final Spatial target = manager.getSpatialTarget();
        if (target != null) {
            _handle.setScale(Math.max(MovePlanarWidget.MIN_SCALE, target.getWorldBound().getRadius()
                    + target.getWorldTranslation().subtract(target.getWorldBound().getCenter(), _calcVec3A).length()));
        }
        targetDataUpdated(manager);
    }
View Full Code Here


        targetDataUpdated(manager);
    }

    @Override
    public void targetDataUpdated(final InteractManager manager) {
        final Spatial target = manager.getSpatialTarget();
        if (target == null) {
            _handle.setScale(1.0);
            _handle.setRotation(Matrix3.IDENTITY);
        } else {
            // update scale of widget using bounding radius
            target.updateGeometricState(0);

            // update arrow rotations from target
            if (_interactMatrix == InteractMatrix.Local) {
                _handle.setRotation(target.getWorldRotation());
            } else {
                _handle.setRotation(Matrix3.IDENTITY);
            }
        }
    }
View Full Code Here

        }
    }

    @Override
    public void render(final Renderer renderer, final InteractManager manager) {
        final Spatial spat = manager.getSpatialTarget();
        if (spat == null) {
            return;
        }

        _handle.setTranslation(spat.getWorldTranslation());
        _handle.updateGeometricState(0);

        renderer.draw(_handle);
    }
View Full Code Here

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

        // act on drag
        final Spatial picked = (Spatial) _results.getPickData(0).getTarget();
        if (picked != null) {
            final Vector3 loc = getNewOffset(oldMouse, current, camera, manager);
            final Transform transform = manager.getSpatialState().getTransform();
            transform.setTranslation(loc.addLocal(transform.getTranslation()));
View Full Code Here

    @Override
    public void targetChanged(final InteractManager manager) {
        if (_dragging) {
            endDrag(manager);
        }
        final Spatial target = manager.getSpatialTarget();
        if (target != null) {
            _handle.setScale(Math.max(RotateWidget.MIN_SCALE, target.getWorldBound().getRadius()
                    + target.getWorldTranslation().subtract(target.getWorldBound().getCenter(), _calcVec3A).length()));
        }
        targetDataUpdated(manager);
    }
View Full Code Here

        }
    }

    @Override
    public void targetDataUpdated(final InteractManager manager) {
        final Spatial target = manager.getSpatialTarget();
        if (target == null) {
            _handle.setScale(1.0);
            setRingRotations(Matrix3.IDENTITY);
        } else {
            // update scale of widget using bounding radius
            target.updateGeometricState(0);

            // update ring rotations from target
            if (_interactMatrix == InteractMatrix.Local) {
                setRingRotations(target.getWorldRotation());
            } else {
                setRingRotations(Matrix3.IDENTITY);
                if (_lastRing != null) {
                    _lastRing.setRotation(_rotateStore);
                }
View Full Code Here

        }
    }

    @Override
    public void render(final Renderer renderer, final InteractManager manager) {
        final Spatial spat = manager.getSpatialTarget();
        if (spat == null) {
            return;
        }

        _handle.setTranslation(spat.getWorldTranslation());
        _handle.updateGeometricState(0);

        renderer.draw(_handle);
    }
View Full Code Here

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

        // act on drag
        final Spatial picked = (Spatial) _results.getPickData(0).getTarget();
        if (picked instanceof InteractRing) {
            final InteractRing ring = (InteractRing) picked;
            _lastRing = ring;
            final ReadOnlyQuaternion rot = getNewAxisRotation(ring, oldMouse, current, camera, manager);
            final Transform transform = manager.getSpatialState().getTransform();
View Full Code Here

                    _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);
                        }
                        _text.setText(topLevel.getName());
                    }
                } else {
                    // No pick, clear label.
                    _text.getSceneHints().setCullHint(CullHint.Always);
                    _text.setText("");
View Full Code Here

            primeModel.setRenderState(cullState);

            for (int i = 0; i < 10; i++) {
                for (int j = 0; j < 10; j++) {
                    // Add copy of model
                    final Spatial copy = primeModel.makeCopy(true);
                    copy.setTranslation(-i * 50, 0, -50 - (j * 50));
                    skNode.attachChild(copy);
                }
            }
        } catch (final Exception ex) {
            ex.printStackTrace();
View Full Code Here

TOP

Related Classes of com.ardor3d.scenegraph.Spatial

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.