Package xenon3d.scene.animators

Source Code of xenon3d.scene.animators.RotationAnimator

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package xenon3d.scene.animators;

import xenon3d.vector.AxisAngle4f;

/**
*
* @author Volker Everts
*/
public class RotationAnimator extends SceneNodeAnimator {

    /** The current axis angle of rotation. */
    private AxisAngle4f angle;

    /** The angular velocity. */
    private float omega;

    /**
     * Creates a new RotationAnimator.
     */
    public RotationAnimator(AxisAngle4f start, float omega) {
        angle = new AxisAngle4f(start);
        this.omega = omega;
    }

    @Override
    public void animate(SceneNode node, float deltaTime) {
        angle.addAngle(omega * deltaTime);
        node.setRotation(angle);
    }

} // end class RotationAnimator
TOP

Related Classes of xenon3d.scene.animators.RotationAnimator

TOP
Copyright © 2018 www.massapi.com. 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.