示例#1
0
	public static BlockModel GetSlopeModel(bool IsFlipX) {
		BlockModel NewBlockModel = new BlockModel ();
		// top
		NewBlockModel.BlockMeshes [0].Verticies.Add (new Vector3(- 0.5f, 0.5f, 0.5f));
		NewBlockModel.BlockMeshes [0].Verticies.Add (new Vector3(0.5f, -0.5f, 0.5f));
		NewBlockModel.BlockMeshes [0].Verticies.Add (new Vector3(0.5f, -0.5f, -0.5f));
		NewBlockModel.BlockMeshes [0].Verticies.Add (new Vector3(- 0.5f, 0.5f, - 0.5f));
		NewBlockModel.AddQuadIndicies (0);
		NewBlockModel.IsSolid[0] = false;
		// bottom
		// no change for bottom
		NewBlockModel.BlockMeshes [1].Verticies.Add (new Vector3(- 0.5f, -0.5f, -0.5f));
		NewBlockModel.BlockMeshes [1].Verticies.Add (new Vector3(0.5f, -0.5f, -0.5f));
		NewBlockModel.BlockMeshes [1].Verticies.Add (new Vector3(0.5f, -0.5f, 0.5f));
		NewBlockModel.BlockMeshes [1].Verticies.Add (new Vector3(- 0.5f, -0.5f, 0.5f));
		NewBlockModel.AddQuadIndicies (1);
		NewBlockModel.IsSolid[1] = false;
		// north
		NewBlockModel.BlockMeshes [2].Verticies.Add (new Vector3(0.5f, -0.5f, 0.5f));
		NewBlockModel.BlockMeshes [2].Verticies.Add (new Vector3(0.5f, -0.5f, 0.5f));
		NewBlockModel.BlockMeshes [2].Verticies.Add (new Vector3(-0.5f, 0.5f, 0.5f));
		NewBlockModel.BlockMeshes [2].Verticies.Add (new Vector3(-0.5f, -0.5f, 0.5f));
		NewBlockModel.AddQuadIndicies (2);
		NewBlockModel.IsSolid[2] = false;
		// east
		// nothing for east
		NewBlockModel.IsSolid[3] = false;
		
		// south
		NewBlockModel.BlockMeshes [4].Verticies.Add (new Vector3(-0.5f, -0.5f, -0.5f));
		NewBlockModel.BlockMeshes [4].Verticies.Add (new Vector3(-0.5f, 0.5f, -0.5f));
		NewBlockModel.BlockMeshes [4].Verticies.Add (new Vector3(0.5f, -0.5f, -0.5f));
		NewBlockModel.BlockMeshes [4].Verticies.Add (new Vector3(0.5f, -0.5f, -0.5f));
		NewBlockModel.AddQuadIndicies (4);
		NewBlockModel.IsSolid[4] = false;
		
		// west
		// west is also the same
		NewBlockModel.BlockMeshes [5].Verticies.Add (new Vector3(-0.5f, -0.5f, 0.5f));
		NewBlockModel.BlockMeshes [5].Verticies.Add (new Vector3(-0.5f, 0.5f, 0.5f));
		NewBlockModel.BlockMeshes [5].Verticies.Add (new Vector3(-0.5f, 0.5f, -0.5f));
		NewBlockModel.BlockMeshes [5].Verticies.Add (new Vector3(-0.5f, -0.5f, -0.5f));
		NewBlockModel.AddQuadIndicies (5);
		NewBlockModel.IsSolid[5] = true;
		
		NewBlockModel.GenerateTextureMaps (16, true, true, true, false, true, true);
		if (IsFlipX) {
			NewBlockModel.FlipModel ();
			NewBlockModel.IsSolid[3] = true;
			NewBlockModel.IsSolid[5] = false;
		}
		return NewBlockModel;
	}