public Door(Transform transform, Material material, Vector3f openPosition)
	{
		this.transform = transform;
		this.openPos = openPosition;
		this.closedPos = transform.getPosition();
		this.material = material;
		
		opening = false;
		closing = false;
		open = false;
		startTime = 0;
		openTime = 0;
		closeTime = 0;
		startCloseTime = 0;
		
		if(door == null)
		{
			door = new Mesh();
			
			Vertex[] doorVerts = new Vertex[]{new Vertex(new Vector3f(0,0,0), new Vector2f(0.5f,1)),
					  new Vertex(new Vector3f(0,1,0), new Vector2f(0.5f,0.75f)),
					  new Vertex(new Vector3f(1,1,0), new Vector2f(0.75f,0.75f)),
					  new Vertex(new Vector3f(1,0,0), new Vector2f(0.75f,1)),
					  
					  new Vertex(new Vector3f(0,0,0), new Vector2f(0.73f,1)),
					  new Vertex(new Vector3f(0,1,0), new Vector2f(0.73f,0.75f)),
					  new Vertex(new Vector3f(0,1,0.125f), new Vector2f(0.75f,0.75f)),
					  new Vertex(new Vector3f(0,0,0.125f), new Vector2f(0.75f,1)),

					  new Vertex(new Vector3f(0,0,0.125f), new Vector2f(0.5f,1)),
					  new Vertex(new Vector3f(0,1,0.125f), new Vector2f(0.5f,0.75f)),
					  new Vertex(new Vector3f(1,1,0.125f), new Vector2f(0.75f,0.75f)),
					  new Vertex(new Vector3f(1,0,0.125f), new Vector2f(0.75f,1)),
					  
					  new Vertex(new Vector3f(1,0,0), new Vector2f(0.73f,1)),
					  new Vertex(new Vector3f(1,1,0), new Vector2f(0.73f,0.75f)),
					  new Vertex(new Vector3f(1,1,0.125f), new Vector2f(0.75f,0.75f)),
					  new Vertex(new Vector3f(1,0,0.125f), new Vector2f(0.75f,1))};
			
			int[] doorIndices = new int[] {0,1,2,
				   0,2,3,
				   6,5,4,
				   7,6,4,
				   10,9,8,
				   11,10,8,
				   12,13,14,
				   12,14,15};

			door.addVertices(doorVerts, doorIndices);
		}
	}