import java.nio.FloatBuffer;
import java.util.ArrayList;

/**
 * CS400 3DMotionCapture
 * BenderSkin
 * 
 * Extended version of OBJ class that holds multiple OBJ classes to construct Bender from Futurama
 * @author Kohei Shinkawa
 * @version 3-11-2010
 * */

public class BenderSkin {
	ArrayList<double[]> vList = new ArrayList<double[]>();
	ArrayList<float[]> vnList = new ArrayList<float[]>();
	ArrayList<FloatBuffer> vtList = new ArrayList<FloatBuffer>();

	OBJ head, midarm, hand, body, midleg, foot;
	/*Matrices to project each part of Bender's body in ideal location*/
	double[] headMatrix ={3, 0,0,-1.1,1,1,1};
	double[] midArmMatrix = {3.3, -1, 0.02, -.18,1,1,1} ;
	double[] handMatrix = {3.3, -1, 0.02, -.5,1,1,1} ;
	double[] bodyMatrix = {2., 0.0, 0., -.62,1,1,1} ;
	double[] midLegMatrix ={3.2, 0.08,-0., -0.31,0.5,0.5,1} ;
	double[] footMatrix = {4, 0.1,-0., 0,0.5, 0.5,1};

	
	public BenderSkin(String folderName){
		OBJ whole = new OBJ(folderName+"/Bender.obj");
		vList = whole.getVList();
		vnList = whole.getVnList();
		vtList = whole.getvtList();
		head = new OBJ(folderName+"/BenderHead.obj", folderName+"/Bender.mtl");
		midarm = new OBJ(folderName+"/BenderMidArm.obj", folderName+"/Bender.mtl");
		hand = new OBJ(folderName+"/BenderHand.obj", folderName+"/Bender.mtl");
		body = new OBJ(folderName+"/BenderBody.obj", folderName+"/Bender.mtl");
		midleg = new OBJ(folderName+"/BenderMidLeg.obj", folderName+"/Bender.mtl");
		foot = new OBJ(folderName+"/BenderFootLeg.obj", folderName+"/Bender.mtl");

	}
	
	public ArrayList<double[]> getVList() {
		return vList;
	}

	public OBJ getHead() {
		return head;
	}

	public OBJ getMidarm() {
		return midarm;
	}

	public OBJ getHand() {
		return hand;
	}

	public OBJ getBody() {
		return body;
	}

	public OBJ getMidleg() {
		return midleg;
	}

	public OBJ getFoot() {
		return foot;
	}

	public double[] getHeadMatrix() {
		return headMatrix;
	}

	public double[] getMidArmMatrix() {
		return midArmMatrix;
	}

	public double[] getHandMatrix() {
		return handMatrix;
	}

	public double[] getBodyMatrix() {
		return bodyMatrix;
	}

	public double[] getMidLegMatrix() {
		return midLegMatrix;
	}

	public double[] getFootMatrix() {
		return footMatrix;
	}
	
	public ArrayList<float[]> getVnList() {
		return vnList;
	}

	public ArrayList<FloatBuffer> getVtList() {
		return vtList;
	}

}
