Package com.ardor3d.extension.animation.skeletal.layer

Examples of com.ardor3d.extension.animation.skeletal.layer.AnimationLayer


    public AnimationManager(final ReadOnlyTimer globalTimer, final SkeletonPose pose, final Spatial sceneRoot) {
        _globalTimer = globalTimer;
        _sceneRoot = sceneRoot;

        // add our base layer
        final AnimationLayer layer = new AnimationLayer(AnimationLayer.BASE_LAYER_NAME);
        layer.setManager(this);
        _layers.add(layer);

        if (pose != null) {
            _applyToPoses = Lists.newArrayList(pose);
        } else {
View Full Code Here


            _lastUpdate = globalTime - (globalTime - _lastUpdate) % _updateRate;
        }

        // move the time forward on the layers
        for (int i = 0; i < _layers.size(); ++i) {
            final AnimationLayer layer = _layers.get(i);
            final AbstractFiniteState state = layer.getCurrentState();
            if (state != null) {
                state.update(globalTime, layer);
            }
        }

        // call apply on blend module, passing in pose
        if (!_applyToPoses.isEmpty()) {
            for (int i = 0; i < _applyToPoses.size(); ++i) {
                final SkeletonPose pose = _applyToPoses.get(i);
                _applier.applyTo(pose, this);
            }
        }

        // apply for non-pose related assets
        _applier.apply(_sceneRoot, this);

        // post update to clear states
        for (int i = 0; i < _layers.size(); ++i) {
            final AnimationLayer layer = _layers.get(i);
            final AbstractFiniteState state = layer.getCurrentState();
            if (state != null) {
                state.postUpdate(layer);
            }
        }
    }
View Full Code Here

     * @return the current source data from the layers of this manager.
     */
    public Map<String, ? extends Object> getCurrentSourceData() {
        // set up our layer blending.
        for (int i = 0; i < _layers.size() - 1; i++) {
            final AnimationLayer layerA = _layers.get(i);
            final AnimationLayer layerB = _layers.get(i + 1);
            layerB.updateLayerBlending(layerA);
        }

        return _layers.get(_layers.size() - 1).getCurrentSourceData();
    }
View Full Code Here

TOP

Related Classes of com.ardor3d.extension.animation.skeletal.layer.AnimationLayer

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.