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


Java TransformType.GUI属性代码示例

本文整理汇总了Java中net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType.GUI属性的典型用法代码示例。如果您正苦于以下问题:Java TransformType.GUI属性的具体用法?Java TransformType.GUI怎么用?Java TransformType.GUI使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType的用法示例。


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

示例1: render

@Override
public void render(ItemStack stack) {
	TransformType type = lastTransform;
	GlStateManager.pushMatrix();
	GlStateManager.translate(0.5, 0.5, 0.5);
	GlStateManager.rotate(180, 1, 0, 0);
	if(type == TransformType.GUI){
		GlStateManager.translate(-1, -0.1, 0);
		GlStateManager.scale(0.8, 0.8, 0.8);
		GlStateManager.rotate(90, 0, 1, 0);
	}else if(type == TransformType.THIRD_PERSON_RIGHT_HAND){
		GlStateManager.rotate(90, 0, 1, 0);
		GlStateManager.rotate(80, -1, 0, 0);
		GlStateManager.rotate(-50, 0, 0, 1);
		GlStateManager.translate(-0.8, 0, 0.4);
	}else if(type == TransformType.GROUND || type == TransformType.FIRST_PERSON_RIGHT_HAND){
		GlStateManager.translate(-0.5, 0, 0.5);
		GlStateManager.rotate(-45, 0, 1, 0);
	}
	GlStateManager.translate(-0.5, -0.5, -0.5);
	int color = ItemNBTHelper.getInteger(stack, "FlagColor", Color.WHITE.getRGB());
	TagManager.getInstance().renderFlag(color, 90);
	Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
	GlStateManager.popMatrix();
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:25,代码来源:ItemRenderFlag.java

示例2: handlePerspective

public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType type)
{
    Pair<? extends IBakedModel, Matrix4f> pair = IPerspectiveAwareModel.MapWrapper.handlePerspective(this, transforms, type);
    if(type == TransformType.GUI && !isCulled && pair.getRight() == null)
    {
        return Pair.of(otherModel, null);
    }
    else if(type != TransformType.GUI && isCulled)
    {
        return Pair.of(otherModel, pair.getRight());
    }
    return pair;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:13,代码来源:ItemLayerModel.java

示例3: handlePerspective

@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType type) {
    Pair<? extends IBakedModel, Matrix4f> pair = IPerspectiveAwareModel.MapWrapper.handlePerspective(this, transforms, type);
    if(type == TransformType.GUI && !isCulled && pair.getRight() == null)
    {
        return Pair.of(otherModel, null);
    }
    else if(type != TransformType.GUI && isCulled)
    {
        return Pair.of(otherModel, pair.getRight());
    }
    return pair;
}
 
开发者ID:DaedalusGame,项目名称:BetterWithAddons,代码行数:13,代码来源:ModelToolShardInner.java

示例4: handlePerspective

@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType type)
      {
          Pair<? extends IBakedModel, Matrix4f> pair = IPerspectiveAwareModel.MapWrapper.handlePerspective(this, transforms, type);
          if(type == TransformType.GUI && !isCulled && pair.getRight() == null)
          {
              return Pair.of(otherModel, null);
          }
          else if(type != TransformType.GUI && isCulled)
          {
              return Pair.of(otherModel, pair.getRight());
          }
          return pair;
      }
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:14,代码来源:ModelCustomLayers.java

示例5: render

@Override
public void render(ItemStack stack) {
	if(ItemStackTools.isValid(stack)){
		if(ItemNBTHelper.verifyExistance(stack, BlockCrystalCluster.TILE_NBT_STACK)){
			NBTTagCompound tileNBT = ItemNBTHelper.getCompound(stack).getCompoundTag(BlockCrystalCluster.TILE_NBT_STACK);
			int health = tileNBT.getInteger("Health");
			ClusterData data = new ClusterData(0, 0);
			data.deserializeNBT(tileNBT.getCompoundTag("ClusterData"));
			GlStateManager.pushMatrix();
			if(lastTransform == TransformType.GUI){
				GlStateManager.translate(0, -0.8, 0);
				GlStateManager.scale(0.8, 0.8, 0.8);
			}
			if(lastTransform == TransformType.HEAD){
				GlStateManager.scale(1.2, 1.2, 1.2);
				GlStateManager.translate(0, -0.4, 0);
			}
			if(lastTransform == TransformType.FIXED){
				GlStateManager.translate(0, -0.8, 0);
			}
			EnumClusterType type = EnumClusterType.values()[stack.getMetadata()];
			Vector3d color = getColor(type);
			renderCluster(data, health, color, type !=EnumClusterType.DARK);
			GlStateManager.popMatrix();
		}
	}
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:27,代码来源:RenderTileCrystalCluster.java

示例6: apppendFrameQuads

private static void apppendFrameQuads(List<List<BakedQuad>> framesQuads, int depth, TransformType transformType, List<BakedQuad> output) {
	final List<BakedQuad> frameQuads = framesQuads.get(depth);
	if (transformType == TransformType.GUI) {
		for (BakedQuad q : frameQuads)
			if (q.getFace() == EnumFacing.SOUTH)
				output.add(q);
	} else {
		output.addAll(frameQuads);
	}
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:10,代码来源:DevNullItemOverride.java

示例7: handlePerspective

@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(ItemCameraTransforms.TransformType cameraTransformType) {
	isGUI = cameraTransformType == TransformType.GUI;
	return MapWrapper.handlePerspective(this, TransformUtils.DEFAULT_BLOCK.getTransforms(), cameraTransformType);
}
 
开发者ID:p455w0rd,项目名称:DankNull,代码行数:5,代码来源:DankNullRenderer.java

示例8: render

@Override
public void render(ItemStack stack) {
	GlStateManager.pushMatrix();
	TransformType type = lastTransform;
	double x = -0.5;
	double y = -1;
	double z = -0.5;
	
	if(type == TransformType.GUI){
		//RenderHelper.disableStandardItemLighting();
		GlStateManager.scale(0.7, 0.7, 0.7);
		y = -1.3;
	}
	
	if(type == TransformType.FIXED){
		x = -0.5;
		y = -1.3;
		z = -0.5;
	}
	
	if(type == TransformType.FIRST_PERSON_LEFT_HAND){
		z += 0.3;
	}
	
	if(type == TransformType.THIRD_PERSON_RIGHT_HAND){
		GlStateManager.translate(4.1, -1.8, -5.1);
		GlStateManager.scale(1.5, 1.5, 1.5);
		GlStateManager.rotate(75, 1, 0, 1);
		x = 0;
		y = 3.65;
		z = 0;
	}
	if(type == TransformType.THIRD_PERSON_LEFT_HAND){
		GlStateManager.translate(-0.65, 0.8, -0.3);
		GlStateManager.scale(1.5, 1.5, 1.5);
		GlStateManager.rotate(70, 1, 0, -1);
		x = 0;
		y = -0.5;
		z = 0;
	}
	
	if(type == TransformType.FIRST_PERSON_LEFT_HAND || type == TransformType.FIRST_PERSON_RIGHT_HAND){
		y = -0.5;
	}
	//GlStateManager.disableLighting();
	//GlStateManager.pushAttrib();
       //RenderHelper.enableStandardItemLighting();
	renderWholeBat(stack, x, y, z);
	GlStateManager.enableBlend();
       //GlStateManager.popAttrib();
       //GlStateManager.enableLighting();
	if(type == TransformType.GUI){
		//RenderHelper.enableGUIStandardItemLighting();
	}
	GlStateManager.popMatrix();
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:56,代码来源:ItemBatRenderer.java

示例9: getRenderScale

public float getRenderScale(TransformType type){
	return type == TransformType.GUI ? 1.5F : type == TransformType.FIXED ? 3.0f : 1.0F;
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:3,代码来源:EntityEssenceInstance.java

示例10: load

@Override
public Pair<? extends IBakedModel, Matrix4f> load(ModelKey key) throws Exception {
	final int depth = key.depth;
	IBakedModel innerModel = key.innerItem;
	// should be caught by earlier method
	Preconditions.checkNotNull(innerModel);
	final TransformType transformType = key.transform;

	final boolean isGui = key.transform == TransformType.GUI;

	final float scale = (float)Math.pow(isGui? scaleFactor2d : scaleFactor3d, depth + 1);

	final Matrix4f quadTransformMatrix = isGui? scale2d(scale) : scale3d(scale);

	final Pair<? extends IBakedModel, Matrix4f> tmp = innerModel.handlePerspective(key.transform);
	innerModel = tmp.getLeft();
	final Matrix4f modelTransformMatrix = tmp.getRight();

	final Matrix4f perspectiveMatrix;
	if (isGui) {
		// bake contained item transform into quads
		if (modelTransformMatrix != null)
			quadTransformMatrix.mul(modelTransformMatrix);

		// use container transform
		perspectiveMatrix = transforms2d.get(TransformType.GUI);
	} else {
		// quads (frame and contents) will be scaled, but contained item's original transform will be returned as perspective
		perspectiveMatrix = modelTransformMatrix;
	}

	wrapTransform(quadTransformMatrix);

	final List<BakedQuad> allQuads = Lists.newArrayList();
	apppendFrameQuads(isGui? frameQuads2d : frameQuads3d, depth, transformType, allQuads);
	appendScaledModelQuads(allQuads, innerModel, quadTransformMatrix, ItemDevNull.NESTED_ITEM_TINT_DELTA);

	if (isGui) {
		appendItemCount(allQuads, key.stackSize);
	}

	final BakedDevNull model = new BakedDevNull(key, allQuads, innerModel.isAmbientOcclusion(), innerModel.isGui3d());
	return Pair.of(model, perspectiveMatrix);
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:44,代码来源:DevNullItemOverride.java

示例11: getModel

private Pair<? extends IBakedModel, Matrix4f> getModel(BakedDevNull current, ModelKey key) {
	boolean isGui = key.transform == TransformType.GUI;

	if (key.equals(current.key)) return Pair.of(current, getTransform(isGui, key.transform));

	if (key.depth >= ItemDevNull.STACK_LIMIT) return selectEmptyModel(ItemDevNull.STACK_LIMIT, isGui, key.transform);

	if (key.innerItem == null)
		return selectEmptyModel(key.depth, isGui, key.transform);

	return wrappedModelCache.getUnchecked(key);
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:12,代码来源:DevNullItemOverride.java


注:本文中的net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType.GUI属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。