1 /******************************************************************************* 2 * Copyright 2011 See AUTHORS file. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 ******************************************************************************/ 16 17 package com.badlogic.gdx.graphics.g3d.model; 18 19 import com.badlogic.gdx.graphics.g3d.Model; 20 import com.badlogic.gdx.math.Quaternion; 21 import com.badlogic.gdx.math.Vector3; 22 import com.badlogic.gdx.utils.Array; 23 24 /** A NodeAnimation defines keyframes for a {@link Node} in a {@link Model}. The keyframes are given as a translation vector, a 25 * rotation quaternion and a scale vector. Keyframes are interpolated linearly for now. Keytimes are given in seconds. 26 * @author badlogic, Xoppa */ 27 public class NodeAnimation { 28 /** the Node affected by this animation **/ 29 public Node node; 30 /** the translation keyframes if any (might be null), sorted by time ascending **/ 31 public Array<NodeKeyframe<Vector3>> translation = null; 32 /** the rotation keyframes if any (might be null), sorted by time ascending **/ 33 public Array<NodeKeyframe<Quaternion>> rotation = null; 34 /** the scaling keyframes if any (might be null), sorted by time ascending **/ 35 public Array<NodeKeyframe<Vector3>> scaling = null; 36 } 37