当前位置: 首页>>代码示例>>Java>>正文


Java Ints.concat方法代码示例

本文整理汇总了Java中com.google.common.primitives.Ints.concat方法的典型用法代码示例。如果您正苦于以下问题:Java Ints.concat方法的具体用法?Java Ints.concat怎么用?Java Ints.concat使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.common.primitives.Ints的用法示例。


在下文中一共展示了Ints.concat方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createBakedQuadCuboid

import com.google.common.primitives.Ints; //导入方法依赖的package包/类
public static List<BakedQuad> createBakedQuadCuboid(float x1, float y1, float z1, float x2, float y2, float z2, TextureAtlasSprite sprite, int red, int green, int blue, int alpha) {
	List<BakedQuad> quads = new ArrayList<BakedQuad>();
	
	int color = (alpha & 0x0ff) << 24 | (blue & 0x0ff) << 16 | (green & 0x0ff) << 8 | (red & 0x0ff);
	int[] vertexData;
	
	vertexData = Ints.concat(
			vertexToInts(x2, y2, z1, color, sprite, x2 * 16, y1 * 16),
			vertexToInts(x2, y1, z1, color, sprite, x2 * 16, y2 * 16),
			vertexToInts(x1, y1, z1, color, sprite, x1 * 16, y2 * 16),
			vertexToInts(x1, y2, z1, color, sprite, x1 * 16, y1 * 16));
	quads.add(new BakedQuad(vertexData, 0, EnumFacing.NORTH, sprite, false, DefaultVertexFormats.BLOCK));
	vertexData = Ints.concat(
			vertexToInts(x1, y2, z2, color, sprite, x1 * 16, y1 * 16),
			vertexToInts(x1, y1, z2, color, sprite, x1 * 16, y2 * 16),
			vertexToInts(x2, y1, z2, color, sprite, x2 * 16, y2 * 16),
			vertexToInts(x2, y2, z2, color, sprite, x2 * 16, y1 * 16));
	quads.add(new BakedQuad(vertexData, 0, EnumFacing.SOUTH, sprite, false, DefaultVertexFormats.BLOCK));
	vertexData = Ints.concat(
			vertexToInts(x1, y2, z1, color, sprite, z1 * 16, y1 * 16),
			vertexToInts(x1, y1, z1, color, sprite, z1 * 16, y2 * 16),
			vertexToInts(x1, y1, z2, color, sprite, z2 * 16, y2 * 16),
			vertexToInts(x1, y2, z2, color, sprite, z2 * 16, y1 * 16));
	quads.add(new BakedQuad(vertexData, 0, EnumFacing.WEST, sprite, false, DefaultVertexFormats.BLOCK));
	vertexData = Ints.concat(
			vertexToInts(x2, y2, z2, color, sprite, z2 * 16, y1 * 16),
			vertexToInts(x2, y1, z2, color, sprite, z2 * 16, y2 * 16),
			vertexToInts(x2, y1, z1, color, sprite, z1 * 16, y2 * 16),
			vertexToInts(x2, y2, z1, color, sprite, z1 * 16, y1 * 16));
	quads.add(new BakedQuad(vertexData, 0, EnumFacing.EAST, sprite, false, DefaultVertexFormats.BLOCK));
	vertexData = Ints.concat(
			vertexToInts(x2, y1, z1, color, sprite, x2 * 16, z1 * 16),
			vertexToInts(x2, y1, z2, color, sprite, x2 * 16, z2 * 16),
			vertexToInts(x1, y1, z2, color, sprite, x1 * 16, z2 * 16),
			vertexToInts(x1, y1, z1, color, sprite, x1 * 16, z1 * 16));
	quads.add(new BakedQuad(vertexData, 0, EnumFacing.DOWN, sprite, false, DefaultVertexFormats.BLOCK));
	vertexData = Ints.concat(
			vertexToInts(x1, y2, z1, color, sprite, x1 * 16, z1 * 16),
			vertexToInts(x1, y2, z2, color, sprite, x1 * 16, z2 * 16),
			vertexToInts(x2, y2, z2, color, sprite, x2 * 16, z2 * 16),
			vertexToInts(x2, y2, z1, color, sprite, x2 * 16, z1 * 16));
	quads.add(new BakedQuad(vertexData, 0, EnumFacing.UP, sprite, false, DefaultVertexFormats.BLOCK));
	
	return quads;
}
 
开发者ID:the-realest-stu,项目名称:Etheric,代码行数:46,代码来源:RenderUtil.java


注:本文中的com.google.common.primitives.Ints.concat方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。