本文整理汇总了Java中net.minecraft.client.renderer.OpenGlHelper.setActiveTexture方法的典型用法代码示例。如果您正苦于以下问题:Java OpenGlHelper.setActiveTexture方法的具体用法?Java OpenGlHelper.setActiveTexture怎么用?Java OpenGlHelper.setActiveTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.OpenGlHelper
的用法示例。
在下文中一共展示了OpenGlHelper.setActiveTexture方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enableLighting
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public static void enableLighting() {
GL11.glDisable((int)3042);
GL11.glEnable((int)3553);
GL11.glDisable((int)2848);
GL11.glDisable((int)3042);
OpenGlHelper.setActiveTexture((int)OpenGlHelper.lightmapTexUnit);
GL11.glMatrixMode((int)5890);
GL11.glLoadIdentity();
float var3 = 0.0039063f;
GL11.glScalef((float)var3, (float)var3, (float)var3);
GL11.glTranslatef((float)8.0f, (float)8.0f, (float)8.0f);
GL11.glMatrixMode((int)5888);
GL11.glTexParameteri((int)3553, (int)10241, (int)9729);
GL11.glTexParameteri((int)3553, (int)10240, (int)9729);
GL11.glTexParameteri((int)3553, (int)10242, (int)10496);
GL11.glTexParameteri((int)3553, (int)10243, (int)10496);
GL11.glColor4f((float)1.0f, (float)1.0f, (float)1.0f, (float)1.0f);
OpenGlHelper.setActiveTexture((int)OpenGlHelper.defaultTexUnit);
}
示例2: drawPlayerModel
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
/**
* This renders the player model in standard inventory position (in later
* versions of Minecraft / Forge, you can simply call
* GuiInventory.drawEntityOnScreen directly instead of copying this code)
*/
public static void drawPlayerModel(int x, int y, int scale, float yaw, float pitch, EntityLivingBase entity) {
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
GL11.glPushMatrix();
GL11.glTranslatef(x, y, 50.0F);
GL11.glScalef(-scale, scale, scale);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
float f2 = entity.renderYawOffset;
float f3 = entity.rotationYaw;
float f4 = entity.rotationPitch;
float f5 = entity.prevRotationYawHead;
float f6 = entity.rotationYawHead;
GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
RenderHelper.enableStandardItemLighting();
GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-((float) Math.atan(pitch / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F);
entity.renderYawOffset = (float) Math.atan(yaw / 40.0F) * 20.0F;
entity.rotationYaw = (float) Math.atan(yaw / 40.0F) * 40.0F;
entity.rotationPitch = -((float) Math.atan(pitch / 40.0F)) * 20.0F;
entity.rotationYawHead = entity.rotationYaw;
entity.prevRotationYawHead = entity.rotationYaw;
Minecraft.getMinecraft().getRenderManager().playerViewY = 180.0F;
Minecraft.getMinecraft().getRenderManager().setRenderShadow(false);
Minecraft.getMinecraft().getRenderManager().renderEntity(entity, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F, false);
Minecraft.getMinecraft().getRenderManager().setRenderShadow(true);
entity.renderYawOffset = f2;
entity.rotationYaw = f3;
entity.rotationPitch = f4;
entity.prevRotationYawHead = f5;
entity.rotationYawHead = f6;
GL11.glPopMatrix();
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GL11.glDisable(GL11.GL_TEXTURE_2D);
OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
示例3: disableLighting
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public static void disableLighting() {
OpenGlHelper.setActiveTexture((int)OpenGlHelper.lightmapTexUnit);
GL11.glDisable((int)3553);
OpenGlHelper.setActiveTexture((int)OpenGlHelper.defaultTexUnit);
GL11.glEnable((int)3042);
GL11.glBlendFunc((int)770, (int)771);
GL11.glEnable((int)2848);
GL11.glDisable((int)2896);
GL11.glDisable((int)3553);
}
示例4: renderEntityIntoGui
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
/**
* Renders an entity into a gui. Parameters - xpos, ypos, scale, rotx, roty, entity.
*/
private void renderEntityIntoGui(int xPos, int yPos, float scale, float rotX, float rotY, EntityLivingBase par5EntityLivingBase)
{
PartEntityPos pos = (PartEntityPos) entityModel.getPartFromName("entitypos");
float[] values = pos.getValues();
par5EntityLivingBase.posX += values[0];
par5EntityLivingBase.posY += values[1];
par5EntityLivingBase.posZ += values[2];
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
GL11.glPushMatrix();
GL11.glTranslatef(xPos, yPos, 200.0F);
GL11.glScalef(-scale, scale, scale);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
RenderHelper.enableStandardItemLighting();
GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-((float)Math.atan((double)(rotY / 40.0F))) * 20.0F + verticalRotation , 1.0F, 0.0F, 0.0F);
GL11.glRotatef(((float)Math.atan((double)(rotX / 40.0F))) * 20.0F + horizontalRotation, 0.0F, -1.0F, 0.0F);
GL11.glTranslated(par5EntityLivingBase.posX, par5EntityLivingBase.posY, par5EntityLivingBase.posZ);
RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
rendermanager.setPlayerViewY(180.0F);
rendermanager.setRenderShadow(false);
rendermanager.doRenderEntity(par5EntityLivingBase, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F, false);
rendermanager.setRenderShadow(true);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GL11.glDisable(GL11.GL_TEXTURE_2D);
OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
GL11.glDisable(GL11.GL_COLOR_MATERIAL);
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glTranslatef(xPos, yPos, 200.0F);
GL11.glScalef(-scale, scale, scale);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(-((float)Math.atan((double)(rotY / 40.0F))) * 20.0F + verticalRotation , 1.0F, 0.0F, 0.0F);
GL11.glRotatef(((float)Math.atan((double)(rotX / 40.0F))) * 20.0F + horizontalRotation, 0.0F, -1.0F, 0.0F);
GL11.glTranslated(par5EntityLivingBase.posX, par5EntityLivingBase.posY, par5EntityLivingBase.posZ);
processRay();
GL11.glPopMatrix();
par5EntityLivingBase.posX -= values[0];
par5EntityLivingBase.posY -= values[1];
par5EntityLivingBase.posZ -= values[2];
}
示例5: renderEntity
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
private void renderEntity(int p_147046_0_, int p_147046_1_, float scale, float p_147046_3_, float p_147046_4_, float z, float rotate, EntityLivingBase p_147046_5_) {
GL11.glEnable(2903);
GL11.glPushMatrix();
GL11.glTranslatef((float) p_147046_0_, (float) p_147046_1_, z);//50.0F
GL11.glScalef((-scale), scale, scale);
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
float var6 = p_147046_5_.renderYawOffset;
float var7 = p_147046_5_.rotationYaw;
float var8 = p_147046_5_.rotationPitch;
float var9 = p_147046_5_.prevRotationYawHead;
float var10 = p_147046_5_.rotationYawHead;
RenderHelper.enableStandardItemLighting();
GL11.glRotatef(-((float) Math.atan((double) (p_147046_4_ / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
p_147046_5_.posX = p_147046_5_.posY = p_147046_5_.posZ = 0;
p_147046_5_.renderYawOffset = (float) Math.atan((double) (p_147046_3_ / 40.0F)) * rotate;
p_147046_5_.rotationYaw = (float) Math.atan((double) (p_147046_3_ / 40.0F)) * 40.0F;
p_147046_5_.rotationPitch = -((float) Math.atan((double) (p_147046_4_ / 40.0F))) * 20.0F;
p_147046_5_.rotationYawHead = (float) Math.atan((double) (p_147046_3_ / 40.0F)) * rotate;
p_147046_5_.prevRotationYawHead = 360f ;
RenderManager.instance.playerViewY = 180.0F;
RenderManager.instance.renderEntityWithPosYaw(p_147046_5_, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
p_147046_5_.renderYawOffset = var6;
p_147046_5_.rotationYaw = var7;
p_147046_5_.rotationPitch = var8;
p_147046_5_.prevRotationYawHead = var9;
p_147046_5_.rotationYawHead = var10;
GL11.glPopMatrix();
RenderHelper.disableStandardItemLighting();
GL11.glDisable(2903);
OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GL11.glDisable(3553);
OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
}