當前位置: 首頁>>代碼示例>>Java>>正文


Java GlStateManager類代碼示例

本文整理匯總了Java中net.minecraft.client.renderer.GlStateManager的典型用法代碼示例。如果您正苦於以下問題:Java GlStateManager類的具體用法?Java GlStateManager怎麽用?Java GlStateManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GlStateManager類屬於net.minecraft.client.renderer包,在下文中一共展示了GlStateManager類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: doRenderLayer

import net.minecraft.client.renderer.GlStateManager; //導入依賴的package包/類
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
    this.endermanRenderer.bindTexture(field_177203_a);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(1, 1);
    GlStateManager.disableLighting();
    GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
    int i = 61680;
    int j = i % 65536;
    int k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
    GlStateManager.enableLighting();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.endermanRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
    this.endermanRenderer.func_177105_a(entitylivingbaseIn, partialTicks);
    GlStateManager.depthMask(true);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:21,代碼來源:LayerEndermanEyes.java

示例2: applyTransformSide

import net.minecraft.client.renderer.GlStateManager; //導入依賴的package包/類
public static void applyTransformSide(ItemTransformVec3f vec, boolean leftHand)
{
    if (vec != ItemTransformVec3f.DEFAULT)
    {
        int i = leftHand ? -1 : 1;
        GlStateManager.translate((float)i * (offsetTranslateX + vec.translation.x), offsetTranslateY + vec.translation.y, offsetTranslateZ + vec.translation.z);
        float f = offsetRotationX + vec.rotation.x;
        float f1 = offsetRotationY + vec.rotation.y;
        float f2 = offsetRotationZ + vec.rotation.z;

        if (leftHand)
        {
            f1 = -f1;
            f2 = -f2;
        }

        GlStateManager.rotate(makeQuaternion(f, f1, f2));
        GlStateManager.scale(offsetScaleX + vec.scale.x, offsetScaleY + vec.scale.y, offsetScaleZ + vec.scale.z);
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:21,代碼來源:ItemCameraTransforms.java

示例3: doRender

import net.minecraft.client.renderer.GlStateManager; //導入依賴的package包/類
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityPainting entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    GlStateManager.translate(x, y, z);
    GlStateManager.rotate(180.0F - entityYaw, 0.0F, 1.0F, 0.0F);
    GlStateManager.enableRescaleNormal();
    this.bindEntityTexture(entity);
    EntityPainting.EnumArt entitypainting$enumart = entity.art;
    float f = 0.0625F;
    GlStateManager.scale(f, f, f);
    this.renderPainting(entity, entitypainting$enumart.sizeX, entitypainting$enumart.sizeY, entitypainting$enumart.offsetX, entitypainting$enumart.offsetY);
    GlStateManager.disableRescaleNormal();
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:22,代碼來源:RenderPainting.java

示例4: doRender

import net.minecraft.client.renderer.GlStateManager; //導入依賴的package包/類
/**
 * Renders the desired {@code T} type Entity.
 */
public void doRender(EntityBoat entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    this.setupTranslation(x, y, z);
    this.setupRotation(entity, entityYaw, partialTicks);
    this.bindEntityTexture(entity);

    if (this.renderOutlines)
    {
        GlStateManager.enableColorMaterial();
        GlStateManager.enableOutlineMode(this.getTeamColor(entity));
    }

    this.modelBoat.render(entity, partialTicks, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);

    if (this.renderOutlines)
    {
        GlStateManager.disableOutlineMode();
        GlStateManager.disableColorMaterial();
    }

    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:28,代碼來源:RenderBoat.java

示例5: doRender

import net.minecraft.client.renderer.GlStateManager; //導入依賴的package包/類
/**
 * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
 * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
 * (Render<T extends Entity>) and this method has signature public void doRender(T entity, double d, double d1,
 * double d2, float f, float f1). But JAD is pre 1.5 so doe
 */
public void doRender(EntityWitherSkull entity, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.pushMatrix();
    GlStateManager.disableCull();
    float f = this.func_82400_a(entity.prevRotationYaw, entity.rotationYaw, partialTicks);
    float f1 = entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTicks;
    GlStateManager.translate((float)x, (float)y, (float)z);
    float f2 = 0.0625F;
    GlStateManager.enableRescaleNormal();
    GlStateManager.scale(-1.0F, -1.0F, 1.0F);
    GlStateManager.enableAlpha();
    this.bindEntityTexture(entity);
    this.skeletonHeadModel.render(entity, 0.0F, 0.0F, 0.0F, f, f1, f2);
    GlStateManager.popMatrix();
    super.doRender(entity, x, y, z, entityYaw, partialTicks);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:23,代碼來源:RenderWitherSkull.java

示例6: func_175266_a

import net.minecraft.client.renderer.GlStateManager; //導入依賴的package包/類
private void func_175266_a(int p_175266_1_, int p_175266_2_, float p_175266_3_, float p_175266_4_, ISpectatorMenuObject p_175266_5_)
{
    this.field_175268_g.getTextureManager().bindTexture(field_175269_a);

    if (p_175266_5_ != SpectatorMenu.field_178657_a)
    {
        int i = (int)(p_175266_4_ * 255.0F);
        GlStateManager.pushMatrix();
        GlStateManager.translate((float)p_175266_2_, p_175266_3_, 0.0F);
        float f = p_175266_5_.func_178662_A_() ? 1.0F : 0.25F;
        GlStateManager.color(f, f, f, p_175266_4_);
        p_175266_5_.func_178663_a(f, i);
        GlStateManager.popMatrix();
        String s = String.valueOf((Object)GameSettings.getKeyDisplayString(this.field_175268_g.gameSettings.keyBindsHotbar[p_175266_1_].getKeyCode()));

        if (i > 3 && p_175266_5_.func_178662_A_())
        {
            this.field_175268_g.fontRendererObj.drawStringWithShadow(s, (float)(p_175266_2_ + 19 - 2 - this.field_175268_g.fontRendererObj.getStringWidth(s)), p_175266_3_ + 6.0F + 3.0F, 16777215 + (i << 24));
        }
    }
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:22,代碼來源:GuiSpectator.java

示例7: applyRotations

import net.minecraft.client.renderer.GlStateManager; //導入依賴的package包/類
@Override
protected void applyRotations(EntityEyeOfSchrodinger schrodinger, float p_77043_2_, float rotationYaw, float partialTicks) {
	GlStateManager.rotate(180F - rotationYaw, 0F, 1F, 0F);
	GlStateManager.rotate(-schrodinger.rotationPitch, 1F, 0F, 0.0F);

	if(schrodinger.deathTime > 0) {
		float f = ((float) schrodinger.deathTime + partialTicks - 1.0F) / 20.0F * 1.6F;
		f = MathHelper.sqrt(f);

		if(f > 1.0F) {
			f = 1.0F;
		}

		GlStateManager.rotate(f * this.getDeathMaxRotation(schrodinger), 0.0F, 0.0F, 1.0F);
	}
}
 
開發者ID:ArekkuusuJerii,項目名稱:Solar,代碼行數:17,代碼來源:EyeOfSchrodingerRenderer.java

示例8: renderParchmentFirstPerson

import net.minecraft.client.renderer.GlStateManager; //導入依賴的package包/類
public static void renderParchmentFirstPerson(float pitch, float p_187463_2_, float p_187463_3_,
		ItemStack parchment)
{
	GlStateManager.pushMatrix();
	GlStateManager.pushAttrib();

	float f = MathHelper.sqrt(p_187463_3_);
	float f1 = -0.2F * MathHelper.sin(p_187463_3_ * (float) Math.PI);
	float f2 = -0.4F * MathHelper.sin(f * (float) Math.PI);
	GlStateManager.translate(0.0F, -f1 / 2.0F, f2);
	float f3 = Minecraft.getMinecraft().getItemRenderer().getMapAngleFromPitch(pitch);
	GlStateManager.translate(0.0F, 0.04F + p_187463_2_ * -1.2F + f3 * -0.5F, -0.72F);
	GlStateManager.rotate(f3 * -85.0F, 1.0F, 0.0F, 0.0F);
	Minecraft.getMinecraft().getItemRenderer().renderArms();
	float f4 = MathHelper.sin(f * (float) Math.PI);
	GlStateManager.rotate(f4 * 20.0F, 1.0F, 0.0F, 0.0F);
	GlStateManager.scale(2.0F, 2.0F, 2.0F);
	renderParchmentFirstPerson(parchment);

	GlStateManager.popAttrib();
	GlStateManager.popMatrix();
}
 
開發者ID:raphydaphy,項目名稱:ArcaneMagic,代碼行數:23,代碼來源:GLHelper.java

示例9: drawBackground

import net.minecraft.client.renderer.GlStateManager; //導入依賴的package包/類
/**
 * Draws the background (i is always 0 as of 1.2.2)
 */
public void drawBackground(int tint)
{
    GlStateManager.disableLighting();
    GlStateManager.disableFog();
    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    this.mc.getTextureManager().bindTexture(optionsBackground);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    float f = 32.0F;
    worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
    worldrenderer.pos(0.0D, (double)this.height, 0.0D).tex(0.0D, (double)((float)this.height / 32.0F + (float)tint)).color(64, 64, 64, 255).endVertex();
    worldrenderer.pos((double)this.width, (double)this.height, 0.0D).tex((double)((float)this.width / 32.0F), (double)((float)this.height / 32.0F + (float)tint)).color(64, 64, 64, 255).endVertex();
    worldrenderer.pos((double)this.width, 0.0D, 0.0D).tex((double)((float)this.width / 32.0F), (double)tint).color(64, 64, 64, 255).endVertex();
    worldrenderer.pos(0.0D, 0.0D, 0.0D).tex(0.0D, (double)tint).color(64, 64, 64, 255).endVertex();
    tessellator.draw();
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:20,代碼來源:GuiScreen.java

示例10: doRenderLayer

import net.minecraft.client.renderer.GlStateManager; //導入依賴的package包/類
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    this.endermanRenderer.bindTexture(RES_ENDERMAN_EYES);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
    GlStateManager.disableLighting();
    GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
    int i = 61680;
    int j = 61680;
    int k = 0;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680.0F, 0.0F);
    GlStateManager.enableLighting();
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.endermanRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    this.endermanRenderer.setLightmap(entitylivingbaseIn, partialTicks);
    GlStateManager.depthMask(true);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:21,代碼來源:LayerEndermanEyes.java

示例11: preRenderCallback

import net.minecraft.client.renderer.GlStateManager; //導入依賴的package包/類
/**
 * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
 * entityLiving, partialTickTime
 */
protected void preRenderCallback(EntityVillager entitylivingbaseIn, float partialTickTime)
{
    float f = 0.9375F;

    if (entitylivingbaseIn.getGrowingAge() < 0)
    {
        f = (float)((double)f * 0.5D);
        this.shadowSize = 0.25F;
    }
    else
    {
        this.shadowSize = 0.5F;
    }

    GlStateManager.scale(f, f, f);
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:21,代碼來源:RenderVillager.java

示例12: render

import net.minecraft.client.renderer.GlStateManager; //導入依賴的package包/類
@Override
public void render(Entity entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
	if (stack.getMetadata() > 0) {
		Minecraft.getMinecraft().getTextureManager().bindTexture(LAYERS[Math.min(LAYERS.length - 1, 1 + stack.getMetadata())]);
		super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
		return;
	}

	for (int i = 0; i < 2; i++) {
		int color = PonySocks.sock.getColor(stack, i > 0);
		GlStateManager.color(
				(float) ((color >> 16) & 0xFF) / 255.0f,
				(float) ((color >> 8) & 0xFF) / 255.0f,
				(float) (color & 0xFF) / 255.0f,
				1.0f
		);
		Minecraft.getMinecraft().getTextureManager().bindTexture(LAYERS[i]);
		super.render(entityIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
	}
}
 
開發者ID:asiekierka,項目名稱:PonySocks2,代碼行數:21,代碼來源:ModelArmorSockBiped.java

示例13: searchBox

import net.minecraft.client.renderer.GlStateManager; //導入依賴的package包/類
public static void searchBox(IBlockPos IBlockPos) {
	RenderUtils.fixDarkLight();
	GlStateManager.resetColor();
	double x = IBlockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
	double y = IBlockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
	double z = IBlockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
	GL11.glBlendFunc(770, 771);
	GL11.glEnable(3042);
	GL11.glLineWidth(1.0F);
	float sinus = 1.0F - MathHelper
			.abs(MathHelper.sin(Minecraft.getSystemTime() % 10000L / 10000.0F * 3.1415927F * 4.0F) * 1.0F);
	GL11.glDisable(3553);
	GL11.glDisable(2929);
	GL11.glDepthMask(false);
	GL11.glColor4f(1.0F - sinus, sinus, 0.0F, 0.15F);
	drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0D, y + 1.0D, z + 1.0D), 1.0F - sinus, sinus, 0.0F, 0.15F);
	GL11.glColor4d(0.0D, 0.0D, 0.0D, 0.5D);
	drawSelectionBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0D, y + 1.0D, z + 1.0D));
	GL11.glEnable(3553);
	GL11.glEnable(2929);
	GL11.glDepthMask(true);
	GL11.glDisable(3042);
}
 
開發者ID:Moudoux,項目名稱:EMC,代碼行數:24,代碼來源:RenderUtils.java

示例14: mouseDragged

import net.minecraft.client.renderer.GlStateManager; //導入依賴的package包/類
protected void mouseDragged(Minecraft mc, int mouseX, int mouseY)
{
    if (this.visible)
    {
        if (this.field_146155_p)
        {
            this.field_146156_o = (float)(mouseX - (this.xPosition + 4)) / (float)(this.width - 8);
            this.field_146156_o = MathHelper.clamp_float(this.field_146156_o, 0.0F, 1.0F);
            mc.gameSettings.setSoundLevel(this.field_146153_r, this.field_146156_o);
            mc.gameSettings.saveOptions();
            this.displayString = this.field_146152_s + ": " + GuiScreenOptionsSounds.this.getSoundVolume(this.field_146153_r);
        }

        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        this.drawTexturedModalRect(this.xPosition + (int)(this.field_146156_o * (float)(this.width - 8)), this.yPosition, 0, 66, 4, 20);
        this.drawTexturedModalRect(this.xPosition + (int)(this.field_146156_o * (float)(this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20);
    }
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:19,代碼來源:GuiScreenOptionsSounds.java

示例15: renderParticle

import net.minecraft.client.renderer.GlStateManager; //導入依賴的package包/類
/**
 * Renders the particle
 */
public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
{
    float f = ((float)this.age + partialTicks) / (float)this.maxAge;
    f = f * f;
    double d0 = this.field_174840_a.posX;
    double d1 = this.field_174840_a.posY;
    double d2 = this.field_174840_a.posZ;
    double d3 = this.field_174843_ax.lastTickPosX + (this.field_174843_ax.posX - this.field_174843_ax.lastTickPosX) * (double)partialTicks;
    double d4 = this.field_174843_ax.lastTickPosY + (this.field_174843_ax.posY - this.field_174843_ax.lastTickPosY) * (double)partialTicks + (double)this.field_174841_aA;
    double d5 = this.field_174843_ax.lastTickPosZ + (this.field_174843_ax.posZ - this.field_174843_ax.lastTickPosZ) * (double)partialTicks;
    double d6 = d0 + (d3 - d0) * (double)f;
    double d7 = d1 + (d4 - d1) * (double)f;
    double d8 = d2 + (d5 - d2) * (double)f;
    int i = this.getBrightnessForRender(partialTicks);
    int j = i % 65536;
    int k = i / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    d6 = d6 - interpPosX;
    d7 = d7 - interpPosY;
    d8 = d8 - interpPosZ;
    this.field_174842_aB.renderEntityWithPosYaw(this.field_174840_a, (double)((float)d6), (double)((float)d7), (double)((float)d8), this.field_174840_a.rotationYaw, partialTicks);
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:27,代碼來源:EntityPickupFX.java


注:本文中的net.minecraft.client.renderer.GlStateManager類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。