Sfoglia il codice sorgente

Removed old animation code

Tankernn 8 anni fa
parent
commit
c0c5073e09

+ 0 - 21
src/main/java/eu/tankernn/gameEngine/animation/Animation.java

@@ -1,21 +0,0 @@
-package eu.tankernn.gameEngine.animation;
-
-import java.util.List;
-
-public class Animation {
-	private int animationID;
-	private int length;
-	private String name;
-	private List<AnimationSection> sections;
-	
-	public int getAnimationID() {
-		return animationID;
-	}
-	public int getLength() {
-		return length;
-	}
-	public String getName() {
-		return name;
-	}
-	
-}

+ 0 - 19
src/main/java/eu/tankernn/gameEngine/animation/AnimationSection.java

@@ -1,19 +0,0 @@
-package eu.tankernn.gameEngine.animation;
-
-import java.util.List;
-
-import org.lwjgl.util.vector.Matrix4f;
-
-public class AnimationSection {
-	private int bodyPart;
-	private List<KeyFrame> keyFrames;
-	
-	public Matrix4f getRotationMatrix(float time) {
-		for (KeyFrame keyFrame : keyFrames) {
-			if (keyFrame.getTime() == time) {
-				return keyFrame.getRotationMatrix();
-			}
-		}
-		return new Matrix4f();
-	}
-}

+ 0 - 94
src/main/java/eu/tankernn/gameEngine/animation/Bone.java

@@ -1,94 +0,0 @@
-package eu.tankernn.gameEngine.animation;
-
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.lwjgl.util.vector.Vector3f;
-import org.lwjgl.util.vector.Vector4f;
-
-public class Bone {
-	private String name;
-	private List<Bone> children;
-	private Bone parent;
-	private float length;
-	private Vector3f position;
-	private Vector4f rotation;
-	
-	public Bone(String name, float length, Vector3f position, Vector4f rotation) {
-		this.name = name;
-		this.children = new ArrayList<Bone>();
-		this.length = length;
-		this.position = position;
-		this.rotation = rotation;
-	}
-	
-	public Bone(String[] args) {
-		this.children = new ArrayList<Bone>();
-		this.position = new Vector3f(Float.parseFloat(args[1]), Float.parseFloat(args[2]), Float.parseFloat(args[3]));
-		this.rotation = new Vector4f(Float.parseFloat(args[4]), Float.parseFloat(args[5]), Float.parseFloat(args[6]), Float.parseFloat(args[7]));
-		this.length = Float.parseFloat(args[8]);
-		this.name = args[9];
-	}
-	
-	public static Bone fromFile(String filename) throws IOException {
-		BufferedReader reader;
-		try {
-			reader = new BufferedReader(new FileReader(filename));
-		} catch (FileNotFoundException e) {
-			e.printStackTrace();
-			return null;
-		}
-		
-		Bone root = new Bone(reader.readLine().split(" "));
-		
-		while (reader.ready()) {
-			String[] line = reader.readLine().split(" ");
-			String depthBuffer = line[0];
-			int depth = depthBuffer.length() - 1;
-			if (depth < 0) {
-				System.err.println("Wrong bone depth.");
-			}
-			
-			
-		}
-		reader.close();
-		return root;
-	}
-	
-	public void addChild(Bone child) {
-		child.setParent(this);
-		this.children.add(child);
-	}
-	
-	public Bone getParent() {
-		return parent;
-	}
-	
-	protected void setParent(Bone parent) {
-		this.parent = parent;
-	}
-	
-	public String getName() {
-		return name;
-	}
-	
-	public List<Bone> getChildren() {
-		return children;
-	}
-	
-	public float getLength() {
-		return length;
-	}
-	
-	public Vector3f getPosition() {
-		return position;
-	}
-	
-	public Vector4f getRotation() {
-		return rotation;
-	}
-}

+ 0 - 47
src/main/java/eu/tankernn/gameEngine/animation/KeyFrame.java

@@ -1,47 +0,0 @@
-package eu.tankernn.gameEngine.animation;
-
-import org.lwjgl.util.vector.Matrix4f;
-import org.lwjgl.util.vector.Vector4f;
-
-public class KeyFrame {
-	private float time;
-	private Vector4f rotation;
-	
-	public KeyFrame(float time, Vector4f rotation) {
-		this.time = time;
-		this.rotation = rotation;
-	}
-	
-	public float getTime() {
-		return time;
-	}
-	
-	public Vector4f getRotation() {
-		return rotation;
-	}
-	
-	public Matrix4f getRotationMatrix() {
-		Matrix4f rotationMatrix = new Matrix4f();
-		rotationMatrix.m00 = (float) (1 - 2 * Math.pow(rotation.y, 2) - 2 * Math.pow(rotation.z, 2));
-		rotationMatrix.m01 = 2 * rotation.x * rotation.y + 2 * rotation.w * rotation.z;
-		rotationMatrix.m02 = 2 * rotation.x * rotation.z - 2 * rotation.w * rotation.y;
-		rotationMatrix.m03 = 0;
-		
-		rotationMatrix.m10 = 2 * rotation.x * rotation.y - 2 * rotation.w * rotation.z;
-		rotationMatrix.m11 = (float) (1 - 2 * Math.pow(rotation.x, 2) - 2 * Math.pow(rotation.z, 2));
-		rotationMatrix.m12 = 2 * rotation.y * rotation.z - 2 * rotation.w * rotation.x;
-		rotationMatrix.m13 = 0;
-		
-		rotationMatrix.m20 = 2 * rotation.x * rotation.z + 2 * rotation.w * rotation.y;
-		rotationMatrix.m21 = 2 * rotation.y * rotation.z + 2 * rotation.w * rotation.x;
-		rotationMatrix.m22 = (float) (1 - 2 * Math.pow(rotation.x, 2) - 2 * Math.pow(rotation.y, 2));
-		rotationMatrix.m23 = 0;
-		
-		rotationMatrix.m30 = 0;
-		rotationMatrix.m31 = 0;
-		rotationMatrix.m32 = 0;
-		rotationMatrix.m33 = 1;
-		return rotationMatrix;
-	}
-	
-}