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


Java TransformType.THIRD_PERSON_RIGHT_HAND属性代码示例

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


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

@Override
public Pair<? extends IBakedModel, Matrix4f> handlePerspective(TransformType cameraTransformType) {
	Matrix4f matr = new Matrix4f();
	matr.setIdentity();
	if (cameraTransformType == TransformType.THIRD_PERSON_RIGHT_HAND) {
		matr.setTranslation(new Vector3f(0.5f, 0.375f, 0.5f));
	}
	if (cameraTransformType == TransformType.THIRD_PERSON_LEFT_HAND) {
		matr.setTranslation(new Vector3f(-0.5f, 0.375f, 0.5f));
	}
	if (cameraTransformType == TransformType.FIRST_PERSON_RIGHT_HAND) {
		matr.setTranslation(new Vector3f(0.25f, 0, 0.5f));
	}
	if (cameraTransformType == TransformType.FIRST_PERSON_LEFT_HAND) {
		matr.setTranslation(new Vector3f(-0.75f, 0, 0.5f));
	}
	// Additional transformations
	TRSRTransformation tr = bakedState.apply(Optional.of(cameraTransformType)).orNull();
	if (tr != null && tr != TRSRTransformation.identity()) {
		matr.mul(tr.getMatrix(), matr);
	}
	return Pair.of(this, matr);
}
 
开发者ID:WorldSEnder,项目名称:MCAnm,代码行数:23,代码来源:ModelLoader.java

示例3: 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


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