// Path: src/main/java/com/github/worldsender/mcanm/common/animation/IAnimation.java
// public interface IAnimation {
// 	/**
// 	 * Describes a BoneTransformation, including rotation, translation and scaling. This class is opaque i.e. all
// 	 * getters and setters don't make defensive copies and states can be manipulated from the outside.
// 	 *
// 	 * @author WorldSEnder
// 	 *
// 	 */
// 	public static class BoneTransformation {
// 		public static final BoneTransformation identity = new BoneTransformation();
// 
// 		private static Vector3f identityScale() {
// 			return new Vector3f(1.0F, 1.0F, 1.0F);
// 		}
// 
// 		public final Matrix4f matrix;
// 
// 		public BoneTransformation() {
// 			this(null, null, null);
// 		}
// 
// 		public BoneTransformation(Vector3f translation, Quat4f quat) {
// 			this(translation, quat, identityScale());
// 		}
// 
// 		public BoneTransformation(Vector3f translation, Quat4f quat, Vector3f scale) {
// 			if (quat == null)
// 				quat = new Quat4f();
// 			if (translation == null)
// 				translation = new Vector3f();
// 			if (scale == null)
// 				scale = identityScale();
// 			this.matrix = Utils.fromRTS(quat, translation, scale, new Matrix4f());
// 		}
// 
// 		public Matrix4f getMatrix() {
// 			return matrix;
// 		}
// 	}
// 
// 	/**
// 	 * Stores the bone's current {@link BoneTransformation} in transform(identified by name). <br>
// 	 * If the requested bone is not known to the animation transform is left untouched and this return
// 	 * <code>false</code>. Otherwise transform is set to the bone's current transform state.
// 	 *
// 	 * @param bone
// 	 *            the name of the bone the matrix is requested
// 	 * @param frame
// 	 *            the current frame in the animation
// 	 * @param transform
// 	 *            the transform to set
// 	 * @return if a transformation has been set
// 	 */
// 	public boolean storeCurrentTransformation(String bone, float frame, BoneTransformation transform);
// }
// 
// Path: src/main/java/com/github/worldsender/mcanm/common/animation/IAnimation.java
// public static class BoneTransformation {
// 	public static final BoneTransformation identity = new BoneTransformation();
// 
// 	private static Vector3f identityScale() {
// 		return new Vector3f(1.0F, 1.0F, 1.0F);
// 	}
// 
// 	public final Matrix4f matrix;
// 
// 	public BoneTransformation() {
// 		this(null, null, null);
// 	}
// 
// 	public BoneTransformation(Vector3f translation, Quat4f quat) {
// 		this(translation, quat, identityScale());
// 	}
// 
// 	public BoneTransformation(Vector3f translation, Quat4f quat, Vector3f scale) {
// 		if (quat == null)
// 			quat = new Quat4f();
// 		if (translation == null)
// 			translation = new Vector3f();
// 		if (scale == null)
// 			scale = identityScale();
// 		this.matrix = Utils.fromRTS(quat, translation, scale, new Matrix4f());
// 	}
// 
// 	public Matrix4f getMatrix() {
// 		return matrix;
// 	}
// }


import java.util.Arrays;
import com.github.worldsender.mcanm.common.animation.IAnimation;
import com.github.worldsender.mcanm.common.animation.IAnimation.BoneTransformation;

package com.github.worldsender.mcanm.client.model.util;



public class Animations {
	/**
	 * A wrapper to chain animations together. If a position for bone &lt;bone&gt; is not given by the firstChoice, it
	 * subsequently asks the second choice and then the other choices.<br>
	 * The animations returned returns no {@link BoneTransformation} if and only if none of the animations would return
	 * a Transformation. Else the Transformation of the first animation that does return one is returned.
	 *
	 * @param choices
	 *            the choices, in the induced order. Usually two or more are given
	 * @return an animation that picks it's transforms from the animations given.
	 */
	public static IAnimation combined(final IAnimation... choices) {
		return combined(Arrays.asList(choices));
	}

	/**
	 * The same as {@link #combined(IAnimation...)}, but the animations are given as an {@link Iterable}.
	 *
	 * @param choices
	 *            the choices to choose from, in the induced order.
	 * @return an animation that picks it's transforms from the animations given
	 * @see #combined(IAnimation...)
	 */
	public static IAnimation combined(final Iterable<IAnimation> choices) {
		return new IAnimation() {
			@Override
			public boolean storeCurrentTransformation(String bone, float frame, BoneTransformation transform) {
				for (IAnimation other : choices) {
					if (other.storeCurrentTransformation(bone, frame, transform)) {
						return true;
					}
				}
				return false;
			}

// Path: src/main/java/com/github/worldsender/mcanm/common/animation/IAnimation.java
// public interface IAnimation {
// 	/**
// 	 * Describes a BoneTransformation, including rotation, translation and scaling. This class is opaque i.e. all
// 	 * getters and setters don't make defensive copies and states can be manipulated from the outside.
// 	 *
// 	 * @author WorldSEnder
// 	 *
// 	 */
// 	public static class BoneTransformation {
// 		public static final BoneTransformation identity = new BoneTransformation();
// 
// 		private static Vector3f identityScale() {
// 			return new Vector3f(1.0F, 1.0F, 1.0F);
// 		}
// 
// 		public final Matrix4f matrix;
// 
// 		public BoneTransformation() {
// 			this(null, null, null);
// 		}
// 
// 		public BoneTransformation(Vector3f translation, Quat4f quat) {
// 			this(translation, quat, identityScale());
// 		}
// 
// 		public BoneTransformation(Vector3f translation, Quat4f quat, Vector3f scale) {
// 			if (quat == null)
// 				quat = new Quat4f();
// 			if (translation == null)
// 				translation = new Vector3f();
// 			if (scale == null)
// 				scale = identityScale();
// 			this.matrix = Utils.fromRTS(quat, translation, scale, new Matrix4f());
// 		}
// 
// 		public Matrix4f getMatrix() {
// 			return matrix;
// 		}
// 	}
// 
// 	/**
// 	 * Stores the bone's current {@link BoneTransformation} in transform(identified by name). <br>
// 	 * If the requested bone is not known to the animation transform is left untouched and this return
// 	 * <code>false</code>. Otherwise transform is set to the bone's current transform state.
// 	 *
// 	 * @param bone
// 	 *            the name of the bone the matrix is requested
// 	 * @param frame
// 	 *            the current frame in the animation
// 	 * @param transform
// 	 *            the transform to set
// 	 * @return if a transformation has been set
// 	 */
// 	public boolean storeCurrentTransformation(String bone, float frame, BoneTransformation transform);
// }
// 
// Path: src/main/java/com/github/worldsender/mcanm/common/animation/IAnimation.java
// public static class BoneTransformation {
// 	public static final BoneTransformation identity = new BoneTransformation();
// 
// 	private static Vector3f identityScale() {
// 		return new Vector3f(1.0F, 1.0F, 1.0F);
// 	}
// 
// 	public final Matrix4f matrix;
// 
// 	public BoneTransformation() {
// 		this(null, null, null);
// 	}
// 
// 	public BoneTransformation(Vector3f translation, Quat4f quat) {
// 		this(translation, quat, identityScale());
// 	}
// 
// 	public BoneTransformation(Vector3f translation, Quat4f quat, Vector3f scale) {
// 		if (quat == null)
// 			quat = new Quat4f();
// 		if (translation == null)
// 			translation = new Vector3f();
// 		if (scale == null)
// 			scale = identityScale();
// 		this.matrix = Utils.fromRTS(quat, translation, scale, new Matrix4f());
// 	}
// 
// 	public Matrix4f getMatrix() {
// 		return matrix;
// 	}
// }


// Path: src/main/java/com/github/worldsender/mcanm/client/model/util/Animations.java
import java.util.Arrays;
import com.github.worldsender.mcanm.common.animation.IAnimation;
import com.github.worldsender.mcanm.common.animation.IAnimation.BoneTransformation;

package com.github.worldsender.mcanm.client.model.util;



public class Animations {
	/**
	 * A wrapper to chain animations together. If a position for bone &lt;bone&gt; is not given by the firstChoice, it
	 * subsequently asks the second choice and then the other choices.<br>
	 * The animations returned returns no {@link BoneTransformation} if and only if none of the animations would return
	 * a Transformation. Else the Transformation of the first animation that does return one is returned.
	 *
	 * @param choices
	 *            the choices, in the induced order. Usually two or more are given
	 * @return an animation that picks it's transforms from the animations given.
	 */
	public static IAnimation combined(final IAnimation... choices) {
		return combined(Arrays.asList(choices));
	}

	/**
	 * The same as {@link #combined(IAnimation...)}, but the animations are given as an {@link Iterable}.
	 *
	 * @param choices
	 *            the choices to choose from, in the induced order.
	 * @return an animation that picks it's transforms from the animations given
	 * @see #combined(IAnimation...)
	 */
	public static IAnimation combined(final Iterable<IAnimation> choices) {
		return new IAnimation() {
			@Override
			public boolean storeCurrentTransformation(String bone, float frame, BoneTransformation transform) {
				for (IAnimation other : choices) {
					if (other.storeCurrentTransformation(bone, frame, transform)) {
						return true;
					}
				}
				return false;
			}

		};
