Package com.ardor3d.extension.interact.data

Examples of com.ardor3d.extension.interact.data.SpatialState


    }

    @Override
    public void applyFilter(final InteractManager manager) {
        final ReadOnlyVector3 oldScale = manager.getSpatialTarget().getScale();
        final SpatialState state = manager.getSpatialState();
        final ReadOnlyVector3 scale = state.getTransform().getScale();

        state.getTransform().setScale( //
                _xAxis ? scale.getX() : oldScale.getX(), //
                _yAxis ? scale.getY() : oldScale.getY(), //
                _zAxis ? scale.getZ() : oldScale.getZ());
    }
View Full Code Here


        _planes = Arrays.copyOf(planes, planes.length);
    }

    @Override
    public void applyFilter(final InteractManager manager) {
        final SpatialState state = manager.getSpatialState();
        _calcVectorA.set(state.getTransform().getTranslation());
        for (final ReadOnlyPlane plane : _planes) {
            final double distance = plane.pseudoDistance(_calcVectorA);
            if (distance < 0) {
                // push us back to the plane.
                _calcVectorB.set(plane.getNormal()).multiplyLocal(-distance);
                _calcVectorA.addLocal(_calcVectorB);
            }
        }

        state.getTransform().setTranslation(_calcVectorA);
    }
View Full Code Here

        _maxScale.set(max);
    }

    @Override
    public void applyFilter(final InteractManager manager) {
        final SpatialState state = manager.getSpatialState();
        final ReadOnlyVector3 scale = state.getTransform().getScale();
        final double x = MathUtils.clamp(scale.getX(), _minScale.getX(), _maxScale.getX());
        final double y = MathUtils.clamp(scale.getY(), _minScale.getY(), _maxScale.getY());
        final double z = MathUtils.clamp(scale.getZ(), _minScale.getZ(), _maxScale.getZ());

        state.getTransform().setScale(x, y, z);
    }
View Full Code Here

        _offsetHeight = offsetHeight;
    }

    @Override
    public void applyFilter(final InteractManager manager) {
        final SpatialState state = manager.getSpatialState();
        final ReadOnlyVector3 trans = state.getTransform().getTranslation();
        final double height = _terrain.getHeightAt(trans.getX(), trans.getZ());
        if (height != trans.getY()) {
            state.getTransform().translate(0, _offsetHeight + height - trans.getY(), 0);
        }
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.extension.interact.data.SpatialState

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.