本文整理汇总了Java中codechicken.lib.vec.Rotation类的典型用法代码示例。如果您正苦于以下问题:Java Rotation类的具体用法?Java Rotation怎么用?Java Rotation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Rotation类属于codechicken.lib.vec包,在下文中一共展示了Rotation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderTracker
import codechicken.lib.vec.Rotation; //导入依赖的package包/类
public static void renderTracker(int freq)
{
GlStateManager.disableLighting();
TextureUtils.bindBlockTexture();
CCRenderState ccrs = CCRenderState.instance();
ccrs.reset();
ccrs.startDrawing(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
ccrs.colour = 0xFFFFFFFF;
model.render(ccrs, new IconTransformation(TextureUtils.getBlockTexture("obsidian")));
ccrs.draw();
Matrix4 pearlMat = RenderUtils.getMatrix(
new Vector3(0, 0.44+RedstoneEther.getSineWave(ClientUtils.getRenderTime(), 7)*0.02, 0),
new Rotation(RedstoneEther.getRotation(ClientUtils.getRenderTime(), freq), new Vector3(0, 1, 0)),
0.04);
TextureUtils.changeTexture("wrcbe:textures/hedronmap.png");
ccrs.startDrawing(4, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
ccrs.colour = freq == 0 ? 0xC0C0C0FF : 0xFFFFFFFF;
CCModelLibrary.icosahedron4.render(ccrs, pearlMat);
ccrs.draw();
GlStateManager.enableLighting();
}
示例2: reloadShape
import codechicken.lib.vec.Rotation; //导入依赖的package包/类
@Override
public void reloadShape() {
final int prevMask = this.connectionMask;
this.centerPart = this.tile().partMap(6);
final double prevSize = this.pipeSize;
this.pipeSize = 0.26;
this.connectionMask = 0;
if (this.centerPart != null) {
if (this.centerPart instanceof ISidedHollowConnect) {
for (int side = 0; side < 6; ++side) {
this.pipeSize = Math.max(this.pipeSize, (((ISidedHollowConnect)this.centerPart).getHollowSize(side) + 1) / 32.0f);
}
}
for (int i = 0; i < 6; ++i) {
for (final Cuboid6 cuboid6 : this.centerPart.getCollisionBoxes()) {
if (cuboid6.intersects(new Cuboid6(this.pipeSize, 0.0, this.pipeSize, 1.0 - this.pipeSize, 0.01, 1.0 - this.pipeSize).apply(Rotation.sideRotations[i].at(new Vector3(0.5, 0.5, 0.5))))) {
this.connectionMask |= 1 << i;
}
}
}
}
if (prevMask != this.connectionMask || prevSize != this.pipeSize) {
this.tile().notifyPartChange((TMultiPart)this);
this.tile().markRender();
}
}
示例3: renderStatic
import codechicken.lib.vec.Rotation; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public boolean renderStatic(final Vector3 pos, final int pass) {
this.reloadShape();
if (this.mat == null) {
this.mat = MicroMaterialRegistry.getMaterial(this.material);
}
if (this.mat != null && this.mat.canRenderInPass(pass)) {
MicroblockRender.renderCuboid(new Vector3((double)this.x(), (double)this.y(), (double)this.z()), this.mat, pass, this.getRenderBounds(), this.connectionMask);
for (int i = 0; i < 6; ++i) {
if ((this.connectionMask & 1 << i) != 0x0) {
MicroblockRender.renderCuboid(new Vector3((double)this.x(), (double)this.y(), (double)this.z()), this.mat, pass, new Cuboid6(0.5 - this.pipeSize, 0.5 + this.pipeSize, 0.5 - this.pipeSize, 0.5 + this.pipeSize, 1.0, 0.5 + this.pipeSize).apply(Rotation.sideRotations[Facing.oppositeSide[i]].at(new Vector3(0.5, 0.5, 0.5))), 1 << Facing.oppositeSide[i]);
}
}
return true;
}
return false;
}
示例4: onBlockActivated
import codechicken.lib.vec.Rotation; //导入依赖的package包/类
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
if (world.isRemote) {
return true;
}
RayTraceResult hit = RayTracer.retraceBlock(world, player, pos);
TileTranslocator ttrans = (TileTranslocator) world.getTileEntity(pos);
if (hit != null && ttrans != null) {
if (hit.subHit < 6) {
Vector3 vhit = new Vector3(hit.hitVec);
vhit.add(-pos.getX() - 0.5, -pos.getY() - 0.5, -pos.getZ() - 0.5);
vhit.apply(Rotation.sideRotations[hit.subHit % 6].inverse());
if (MathHelper.between(-2 / 16D, vhit.x, 2 / 16D) && MathHelper.between(-2 / 16D, vhit.z, 2 / 16D)) {
hit.subHit += 6;
}
}
return ttrans.attachments[hit.subHit % 6].activate(player, hit.subHit / 6);
}
return false;
}
示例5: setActive
import codechicken.lib.vec.Rotation; //导入依赖的package包/类
@Override
public void setActive(boolean on)
{
super.setActive(on);
updateChange();
tile().notifyNeighborChange(Rotation.rotateSide(side(), rotation()));
}
示例6: getPoweringLevel
import codechicken.lib.vec.Rotation; //导入依赖的package包/类
public int getPoweringLevel() {
int s = RedstoneInteractions.getPowerTo(this, Rotation.rotateSide(side(), rotation()));
int i = getInternalPower();
if (i > s)
s = i;
return s;
}
示例7: getInternalPower
import codechicken.lib.vec.Rotation; //导入依赖的package包/类
public int getInternalPower() {
TMultiPart part = tile().partMap(Rotation.rotateSide(side(), rotation()));
if (part instanceof IRedstonePart) {
IRedstonePart rp = (IRedstonePart) part;
return Math.max(rp.strongPowerLevel(side()), rp.weakPowerLevel(side())) << 4;
}
return 0;
}
示例8: getCollisionBoxes
import codechicken.lib.vec.Rotation; //导入依赖的package包/类
@Override
public Iterable<Cuboid6> getCollisionBoxes() {
final ArrayList<Cuboid6> boxes = new ArrayList<Cuboid6>();
if (this.isEthereal()) {
return boxes;
}
boxes.add(this.getRenderBounds());
for (int i = 0; i < 6; ++i) {
if ((this.connectionMask & 1 << i) != 0x0) {
boxes.add(new Cuboid6(0.5 - this.pipeSize, 0.5 + this.pipeSize, 0.5 - this.pipeSize, 0.5 + this.pipeSize, 1.0, 0.5 + this.pipeSize).apply(Rotation.sideRotations[Facing.oppositeSide[i]].at(new Vector3(0.5, 0.5, 0.5))));
}
}
return boxes;
}
示例9: operate
import codechicken.lib.vec.Rotation; //导入依赖的package包/类
@Override
public void operate() {
if(normalRef != null)
setNormal(normalRef[vertexIndex]);
else
setNormal(Rotation.axes[side]);
}
示例10: computeO
import codechicken.lib.vec.Rotation; //导入依赖的package包/类
public LC computeO(Vector3 vec, int side) {
Vector3 v1 = Rotation.axes[((side & 0xE) + 3) % 6];
Vector3 v2 = Rotation.axes[((side & 0xE) + 5) % 6];
float d1 = (float) vec.scalarProject(v1);
float d2 = 1 - d1;
float d3 = (float) vec.scalarProject(v2);
float d4 = 1 - d3;
return set(side, d2 * d4, d2 * d3, d1 * d4, d1 * d3);
}
示例11: doRenderLayer
import codechicken.lib.vec.Rotation; //导入依赖的package包/类
@Override
public void doRenderLayer(AbstractClientPlayer entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
if (uuid1.equals(entity.getUniqueID()) || uuid2.equals(entity.getUniqueID()) || uuid3.equals(entity.getUniqueID()) || uuid4.equals(entity.getUniqueID())) {
GlStateManager.pushMatrix();
Matrix4 matrix4 = new Matrix4();
matrix4.apply(new Rotation(MathHelper.torad * 180, new Vector3(1, 0, 0)));
matrix4.apply(new Scale(0.5));
matrix4.glApply();
if (entity.isSneaking()) {
GlStateManager.translate(0, -0.5, 0);
}
if (entity.isElytraFlying()) {
headPitch = -45;
}
GlStateManager.rotate(netHeadYaw, 0, -1, 0);
GlStateManager.rotate(headPitch, 1, 0, 0);
GlStateManager.translate(0, 1, 0);
RenderTileEnderTank.renderTank(CCRenderState.instance(), 0, (float) (MathHelper.torad * 90F), new Frequency(), -0.5, 0, -0.5, 0);
FluidStack fluidStack = FluidUtils.water.copy();
float bob = 0.45F + RenderUtils.getPearlBob(ClientUtils.getRenderTime()) * 2;
fluidStack.amount = (int) MathHelper.map(bob, 0.2, 0.6, 1000, 14000);
RenderTileEnderTank.renderLiquid(fluidStack, -0.5, 0, -0.5);
GlStateManager.popMatrix();
}
}
示例12: renderChest
import codechicken.lib.vec.Rotation; //导入依赖的package包/类
public static void renderChest(int rotation, Frequency freq, double x, double y, double z, int offset, float lidAngle) {
TileEntityRendererDispatcher info = TileEntityRendererDispatcher.instance;
CCRenderState ccrs = CCRenderState.instance();
ccrs.reset();
renderEndPortal.render(x, y, z, 0, info.entityX, info.entityY, info.entityZ, info.renderEngine);
GlStateManager.color(1, 1, 1, 1);
TextureUtils.changeTexture("enderstorage:textures/enderchest.png");
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
GlStateManager.color(1, 1, 1, 1);
GlStateManager.translate(x, y + 1.0, z + 1.0F);
GlStateManager.scale(1.0F, -1F, -1F);
GlStateManager.translate(0.5F, 0.5F, 0.5F);
GlStateManager.rotate(rotation * 90, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, -0.5F);
model.chestLid.rotateAngleX = lidAngle;
model.render(freq.hasOwner());
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, z);
renderButtons(freq, rotation, lidAngle);
GlStateManager.popMatrix();
double time = ClientUtils.getRenderTime() + offset;
Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(x + 0.5, y + 0.2 + lidAngle * -0.5 + RenderUtils.getPearlBob(time), z + 0.5), new Rotation(time / 3, new Vector3(0, 1, 0)), 0.04);
GlStateManager.disableLighting();
TextureUtils.changeTexture("enderstorage:textures/hedronmap.png");
GlStateManager.pushMatrix();
ccrs.startDrawing(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
CCModelLibrary.icosahedron7.render(ccrs, pearlMat);
ccrs.draw();
GlStateManager.popMatrix();
GlStateManager.enableLighting();
}
示例13: operate
import codechicken.lib.vec.Rotation; //导入依赖的package包/类
@Override
public void operate(CCRenderState state) {
if (normalRef != null) {
state.normal.set(normalRef[state.vertexIndex]);
} else {
state.normal.set(Rotation.axes[state.side]);
}
}
示例14: reducePlanar
import codechicken.lib.vec.Rotation; //导入依赖的package包/类
public PlanarLightModel reducePlanar() {
int[] colours = new int[6];
for (int i = 0; i < 6; i++) {
colours[i] = apply(-1, Rotation.axes[i]);
}
return new PlanarLightModel(colours);
}
示例15: renderItem
import codechicken.lib.vec.Rotation; //导入依赖的package包/类
@Override
public void renderItem(ItemStack stack, TransformType transformType) {
renderWrapped(stack);
double rot = ClientUtils.getRenderTime() / 3F;
double height;
double size;
double updown = (float) Math.sin(((ClientUtils.getRenderTime() % 50) / 25F) * 3.141593) * 0.2;
if (stack.getMetadata() == 0) {
height = 0.9;
size = 0.08;
} else {
height = 0.5;
size = 0.05;
}
CCRenderState ccrs = CCRenderState.instance();
ccrs.reset();
Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(0.5, height + (updown + 0.3), 0.5), new Rotation(rot, new Vector3(0, 1, 0)), size);
disableLighting();
pushMatrix();
TextureUtils.changeTexture("chickenchunks:textures/hedronmap.png");
ccrs.startDrawing(4, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
CCModelLibrary.icosahedron4.render(ccrs, pearlMat);
ccrs.draw();
popMatrix();
enableLighting();
}