本文整理汇总了Java中net.minecraft.client.renderer.ActiveRenderInfo.rotationXZ方法的典型用法代码示例。如果您正苦于以下问题:Java ActiveRenderInfo.rotationXZ方法的具体用法?Java ActiveRenderInfo.rotationXZ怎么用?Java ActiveRenderInfo.rotationXZ使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.ActiveRenderInfo
的用法示例。
在下文中一共展示了ActiveRenderInfo.rotationXZ方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cleanActiveRenderInfo
import net.minecraft.client.renderer.ActiveRenderInfo; //导入方法依赖的package包/类
private void cleanActiveRenderInfo(ItemRenderType renderType) {
renderInfo[0] = ActiveRenderInfo.rotationX;
renderInfo[1] = ActiveRenderInfo.rotationXZ;
renderInfo[2] = ActiveRenderInfo.rotationZ;
renderInfo[3] = ActiveRenderInfo.rotationYZ;
renderInfo[4] = ActiveRenderInfo.rotationXY;
switch (renderType) {
case ENTITY:
break;
case EQUIPPED:
ActiveRenderInfo.rotationX = 0.85535365F;
ActiveRenderInfo.rotationXZ = 0.9868404F;
ActiveRenderInfo.rotationZ = -0.51804453F;
ActiveRenderInfo.rotationYZ = 0.083717324F;
ActiveRenderInfo.rotationXY = 0.13822734F;
break;
case EQUIPPED_FIRST_PERSON:
ActiveRenderInfo.rotationX = -0.4186075F;
ActiveRenderInfo.rotationXZ = 0.99932945F;
ActiveRenderInfo.rotationZ = -0.90816724F;
ActiveRenderInfo.rotationYZ = 0.033253096F;
ActiveRenderInfo.rotationXY = -0.015327567F;
break;
case INVENTORY:
ActiveRenderInfo.rotationX = -0.71445745F;
ActiveRenderInfo.rotationXZ = 0.9573291F;
ActiveRenderInfo.rotationZ = 0.69967884F;
ActiveRenderInfo.rotationYZ = -0.20220716F;
ActiveRenderInfo.rotationXY = -0.20647818F;
break;
case FIRST_PERSON_MAP:
break;
}
}
示例2: restoreActiveRenderInfo
import net.minecraft.client.renderer.ActiveRenderInfo; //导入方法依赖的package包/类
private void restoreActiveRenderInfo() {
if(renderInfo[0] != -1) ActiveRenderInfo.rotationX = renderInfo[0];
if(renderInfo[1] != -1) ActiveRenderInfo.rotationXZ = renderInfo[1];
if(renderInfo[2] != -1) ActiveRenderInfo.rotationZ = renderInfo[2];
if(renderInfo[3] != -1) ActiveRenderInfo.rotationYZ = renderInfo[3];
if(renderInfo[4] != -1) ActiveRenderInfo.rotationXY = renderInfo[4];
for (int i = 0; i < renderInfo.length; i++) {
renderInfo[i] = -1;
}
}
示例3: render
import net.minecraft.client.renderer.ActiveRenderInfo; //导入方法依赖的package包/类
private void render(Tessellator tessellator, float pTicks) {
float arX = ActiveRenderInfo.rotationX;
float arXZ = ActiveRenderInfo.rotationXZ;
float arZ = ActiveRenderInfo.rotationZ;
float arYZ = ActiveRenderInfo.rotationYZ;
float arXY = ActiveRenderInfo.rotationXY;
GL11.glPushMatrix();
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
float agescale = (float) (ClientHandler.ticks % 800) / 400F;
if(agescale >= 1.0F) agescale = 2 - agescale;
float size = 0.2F + 0.1F * agescale;
if(parent != null) {
size += size * (((float) parent.getSizeStage()) * 0.04F);
}
float anglePerc = (float) (ClientHandler.ticks % 300) / 300F;
float angle = RAD - RAD * anglePerc;
Vector3 iV = MiscUtils.interpolateEntityPosition(Minecraft.getMinecraft().renderViewEntity, pTicks);
if(parent != null && parent.getSizeStage() > 4) {
float mult = 0.001F * (parent.getSizeStage() - 4F);
Vector3 shake = new Vector3(
RAND.nextFloat() * mult * (RAND.nextBoolean() ? 1 : -1),
RAND.nextFloat() * mult * (RAND.nextBoolean() ? 1 : -1),
RAND.nextFloat() * mult * (RAND.nextBoolean() ? 1 : -1));
iV.add(shake);
}
GL11.glTranslated(-iV.getX(), -iV.getY(), -iV.getZ());
UtilsFX.bindTexture(TC_VORTEX_TEXTURE);
tessellator.startDrawingQuads();
tessellator.setBrightness(220);
tessellator.setColorRGBA_F(1F, 1F, 1F, 1F);
Vec3 v1 = Vec3.createVectorHelper(-arX * size - arYZ * size, -arXZ * size, -arZ * size - arXY * size);
Vec3 v2 = Vec3.createVectorHelper(-arX * size + arYZ * size, arXZ * size, -arZ * size + arXY * size);
Vec3 v3 = Vec3.createVectorHelper(arX * size + arYZ * size, arXZ * size, arZ * size + arXY * size);
Vec3 v4 = Vec3.createVectorHelper(arX * size - arYZ * size, -arXZ * size, arZ * size - arXY * size);
if (angle != 0.0F) {
Vec3 pvec = Vec3.createVectorHelper(iV.getX(), iV.getY(), iV.getZ());
Vec3 tvec = Vec3.createVectorHelper(x, y, z);
Vec3 qvec = pvec.subtract(tvec).normalize();
QuadHelper.setAxis(qvec, angle).rotate(v1);
QuadHelper.setAxis(qvec, angle).rotate(v2);
QuadHelper.setAxis(qvec, angle).rotate(v3);
QuadHelper.setAxis(qvec, angle).rotate(v4);
}
tessellator.setNormal(0.0F, 0.0F, -1.0F);
tessellator.addVertexWithUV(x + v1.xCoord, y + v1.yCoord, z + v1.zCoord, 0, 1);
tessellator.addVertexWithUV(x + v2.xCoord, y + v2.yCoord, z + v2.zCoord, 1, 1);
tessellator.addVertexWithUV(x + v3.xCoord, y + v3.yCoord, z + v3.zCoord, 1, 0);
tessellator.addVertexWithUV(x + v4.xCoord, y + v4.yCoord, z + v4.zCoord, 0, 0);
tessellator.draw();
GL11.glDisable(GL11.GL_BLEND);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glPopMatrix();
}
示例4: renderParticles
import net.minecraft.client.renderer.ActiveRenderInfo; //导入方法依赖的package包/类
/**
* Renders all current particles. Args player, partialTickTime
*/
public void renderParticles(Entity par1Entity, float par2)
{
float f1 = ActiveRenderInfo.rotationX;
float f2 = ActiveRenderInfo.rotationZ;
float f3 = ActiveRenderInfo.rotationYZ;
float f4 = ActiveRenderInfo.rotationXY;
float f5 = ActiveRenderInfo.rotationXZ;
EntityFX.interpPosX = par1Entity.lastTickPosX + (par1Entity.posX - par1Entity.lastTickPosX) * (double)par2;
EntityFX.interpPosY = par1Entity.lastTickPosY + (par1Entity.posY - par1Entity.lastTickPosY) * (double)par2;
EntityFX.interpPosZ = par1Entity.lastTickPosZ + (par1Entity.posZ - par1Entity.lastTickPosZ) * (double)par2;
for (int i = 0; i < 3; ++i)
{
if (!this.fxLayers[i].isEmpty())
{
switch (i)
{
case 0:
default:
this.renderer.bindTexture(particleTextures);
break;
case 1:
this.renderer.bindTexture(TextureMap.locationBlocksTexture);
break;
case 2:
this.renderer.bindTexture(TextureMap.locationItemsTexture);
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDepthMask(false);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
for (int j = 0; j < this.fxLayers[i].size(); ++j)
{
EntityFX entityfx = (EntityFX)this.fxLayers[i].get(j);
if (entityfx == null) continue;
tessellator.setBrightness(entityfx.getBrightnessForRender(par2));
entityfx.renderParticle(tessellator, par2, f1, f5, f2, f3, f4);
}
tessellator.draw();
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
}
}
}
示例5: renderParticles
import net.minecraft.client.renderer.ActiveRenderInfo; //导入方法依赖的package包/类
public void renderParticles(Entity p_78874_1_, float p_78874_2_)
{
float f1 = ActiveRenderInfo.rotationX;
float f2 = ActiveRenderInfo.rotationZ;
float f3 = ActiveRenderInfo.rotationYZ;
float f4 = ActiveRenderInfo.rotationXY;
float f5 = ActiveRenderInfo.rotationXZ;
EntityFX.interpPosX = p_78874_1_.lastTickPosX + (p_78874_1_.posX - p_78874_1_.lastTickPosX) * (double)p_78874_2_;
EntityFX.interpPosY = p_78874_1_.lastTickPosY + (p_78874_1_.posY - p_78874_1_.lastTickPosY) * (double)p_78874_2_;
EntityFX.interpPosZ = p_78874_1_.lastTickPosZ + (p_78874_1_.posZ - p_78874_1_.lastTickPosZ) * (double)p_78874_2_;
for (int k = 0; k < 3; ++k)
{
final int i = k;
if (!this.fxLayers[i].isEmpty())
{
switch (i)
{
case 0:
default:
this.renderer.bindTexture(particleTextures);
break;
case 1:
this.renderer.bindTexture(TextureMap.locationBlocksTexture);
break;
case 2:
this.renderer.bindTexture(TextureMap.locationItemsTexture);
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDepthMask(false);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
for (int j = 0; j < this.fxLayers[i].size(); ++j)
{
final EntityFX entityfx = (EntityFX)this.fxLayers[i].get(j);
if (entityfx == null) continue;
tessellator.setBrightness(entityfx.getBrightnessForRender(p_78874_2_));
try
{
entityfx.renderParticle(tessellator, p_78874_2_, f1, f5, f2, f3, f4);
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering Particle");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Particle being rendered");
crashreportcategory.addCrashSectionCallable("Particle", new Callable()
{
private static final String __OBFID = "CL_00000918";
public String call()
{
return entityfx.toString();
}
});
crashreportcategory.addCrashSectionCallable("Particle Type", new Callable()
{
private static final String __OBFID = "CL_00000919";
public String call()
{
return i == 0 ? "MISC_TEXTURE" : (i == 1 ? "TERRAIN_TEXTURE" : (i == 2 ? "ITEM_TEXTURE" : (i == 3 ? "ENTITY_PARTICLE_TEXTURE" : "Unknown - " + i)));
}
});
throw new ReportedException(crashreport);
}
}
tessellator.draw();
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
}
}
}
示例6: doRender
import net.minecraft.client.renderer.ActiveRenderInfo; //导入方法依赖的package包/类
@Override
public void doRender(Entity entity, double x, double y, double z, float fq, float ptt) {
EntityEnergyPacket ent = (EntityEnergyPacket) entity;
Tessellator tess = Tessellator.instance;
glPushMatrix();
glDepthMask(false);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Minecraft.getMinecraft().renderEngine.bindTexture(tex);
float scale = 0.1F;
float[] pos = {(float) x, (float) y, (float) z};
float[] rot = new float[] {ActiveRenderInfo.rotationX, ActiveRenderInfo.rotationXZ, ActiveRenderInfo.rotationZ, ActiveRenderInfo.rotationYZ, ActiveRenderInfo.rotationXY};
tess.startDrawingQuads();
tess.setBrightness(240);
//tess.setColorRGBA_F(1F, 0F, 1F, 0.5F);
Colourizer colour = ent.getColour();
tess.setColorRGBA_F(colour.rgb[0], colour.rgb[1], colour.rgb[2], 0.3F);
FXHelper.drawTrackingParticle(tess, pos, scale, rot);
tess.draw();
glDisable(GL_BLEND);
glDepthMask(true);
glPopMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(FXHelper.getParticleTexture());
}