本文整理汇总了Java中codechicken.lib.vec.Cuboid6类的典型用法代码示例。如果您正苦于以下问题:Java Cuboid6类的具体用法?Java Cuboid6怎么用?Java Cuboid6使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Cuboid6类属于codechicken.lib.vec包,在下文中一共展示了Cuboid6类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSideFromBounds
import codechicken.lib.vec.Cuboid6; //导入依赖的package包/类
public int getSideFromBounds(final Cuboid6 bounds) {
if (bounds.max.y != 1.0) {
return 0;
}
if (bounds.min.y != 0.0) {
return 1;
}
if (bounds.max.z != 1.0) {
return 2;
}
if (bounds.min.z != 0.0) {
return 3;
}
if (bounds.max.x != 1.0) {
return 4;
}
if (bounds.min.x != 0.0) {
return 5;
}
return -1;
}
示例2: getCollisionBoxes
import codechicken.lib.vec.Cuboid6; //导入依赖的package包/类
@Override
public Iterable<Cuboid6> getCollisionBoxes() {
final List<Cuboid6> t = new ArrayList<Cuboid6>();
if (this.isEthereal()) {
return t;
}
if ((this.connectionMask & 0x2) != 0x0) {
t.add(PartWall.partCuboids[1].copy());
}
for (int i = 2; i < 6; ++i) {
if ((this.connectionMask & 1 << i) != 0x0) {
t.add(PartWall.partCuboids[i].copy());
}
}
return t;
}
示例3: reloadShape
import codechicken.lib.vec.Cuboid6; //导入依赖的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();
}
}
示例4: renderStatic
import codechicken.lib.vec.Cuboid6; //导入依赖的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;
}
示例5: renderMicroFace
import codechicken.lib.vec.Cuboid6; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void renderMicroFace(final Vector3 pos, final int pass, final Cuboid6 bounds) {
float[] col = BlockColor.initColor[this.meta()];
if (XUHelperClient.clientPlayer().getEntityWorld() != null && pass != -1) {
col = BlockColorData.getColorData((IBlockAccess)XUHelperClient.clientPlayer().getEntityWorld(), (int)pos.x, (int)pos.y, (int)pos.z, this.meta());
}
else {
final Entity holder = (Entity)XUHelperClient.clientPlayer();
if (holder != null) {
final TileEntity tiledata = holder.worldObj.getTileEntity(BlockColorData.dataBlockX((int)Math.floor(holder.posX)), BlockColorData.dataBlockY((int)holder.posY), BlockColorData.dataBlockZ((int)Math.floor(holder.posZ)));
if (tiledata instanceof TileEntityBlockColorData) {
col = ((TileEntityBlockColorData)tiledata).palette[this.meta()];
}
}
}
final int c = (int)(col[0] * 255.0f) << 24 | (int)(col[1] * 255.0f) << 16 | (int)(col[2] * 255.0f) << 8 | 0xFF;
MaterialRenderHelper.start(pos, pass, (UVTransformation)this.icont()).blockColour(c).lighting().render();
}
示例6: getPart
import codechicken.lib.vec.Cuboid6; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public TMultiPart getPart(final Vector3 pos, final Cuboid6 bounds) {
final World world = XUHelperClient.clientWorld();
final TileMultipart t = TileMultipart.getOrConvertTile(world, new BlockCoord(pos));
if (t == null) {
return null;
}
for (final TMultiPart part : t.jPartList()) {
if (part instanceof JNormalOcclusion) {
for (final Cuboid6 bound : ((JNormalOcclusion)part).getOcclusionBoxes()) {
if (bound.intersects(bounds)) {
return part;
}
}
}
}
return null;
}
示例7: isFlush
import codechicken.lib.vec.Cuboid6; //导入依赖的package包/类
public boolean isFlush(final Cuboid6 bounds) {
int i = 0;
if (bounds.max.y != 1.0) {
++i;
}
if (bounds.min.y != 0.0) {
++i;
}
if (bounds.max.z != 1.0) {
++i;
}
if (bounds.min.z != 0.0) {
++i;
}
if (bounds.max.x != 1.0) {
++i;
}
if (bounds.min.x != 0.0) {
++i;
}
return i <= 1;
}
示例8: sideSize
import codechicken.lib.vec.Cuboid6; //导入依赖的package包/类
public double sideSize(final Cuboid6 bounds) {
if (bounds.max.y != 1.0) {
return bounds.max.y;
}
if (bounds.min.y != 0.0) {
return bounds.min.y;
}
if (bounds.max.z != 1.0) {
return bounds.max.z;
}
if (bounds.min.z != 0.0) {
return bounds.min.z;
}
if (bounds.max.x != 1.0) {
return bounds.max.x;
}
if (bounds.min.x != 0.0) {
return bounds.min.x;
}
return 0.0;
}
示例9: hasMatchingPart
import codechicken.lib.vec.Cuboid6; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public boolean hasMatchingPart(final Cuboid6 part, final int x, final int y, final int z) {
final TileEntity tile_base = this.world.getTileEntity(x, y, z);
if (tile_base != null && tile_base instanceof TileMultipart) {
final scala.collection.Iterator<TMultiPart> parts = (scala.collection.Iterator<TMultiPart>)((TileMultipart)tile_base).partList().toIterator();
while (parts.hasNext()) {
final TMultiPart p = (TMultiPart)parts.next();
if (p instanceof CommonMicroblock) {
final CommonMicroblock mat = (CommonMicroblock)p;
if (!this.equalCubes(mat.getBounds(), part)) {
continue;
}
final int material = mat.getMaterial();
if (MicroMaterialRegistry.getMaterial(material) == this) {
return true;
}
continue;
}
}
}
return false;
}
示例10: getHalfType
import codechicken.lib.vec.Cuboid6; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public int getHalfType(final Block block, final int side, final int x, final int y, final int z, final int ax, final int ay, final int az, final int bx, final int by, final int bz, final Cuboid6 part) {
final boolean a = this.hasMatchingPart(part, x + ax, y + ay, z + az);
final boolean b = this.hasMatchingPart(part, x + bx, y + by, z + bz);
if (a) {
if (!b) {
return 2;
}
if (this.hasMatchingPart(part, x + ax + bx, y + ay + by, z + az + bz)) {
return 3;
}
return 4;
}
else {
if (b) {
return 1;
}
return 0;
}
}
示例11: expandToInclude
import codechicken.lib.vec.Cuboid6; //导入依赖的package包/类
public Cuboid6 expandToInclude(final Cuboid6 a, final Vector3 v) {
if (a.min.x > v.x) {
a.min.x = v.x;
}
if (a.min.y > v.y) {
a.min.y = v.y;
}
if (a.min.z > v.z) {
a.min.z = v.z;
}
if (a.max.y < v.y) {
a.max.y = v.y;
}
if (a.max.x < v.x) {
a.max.x = v.x;
}
if (a.max.z < v.z) {
a.max.z = v.z;
}
return a;
}
示例12: shrinkToEnclose
import codechicken.lib.vec.Cuboid6; //导入依赖的package包/类
public Cuboid6 shrinkToEnclose(final Cuboid6 a, final Cuboid6 c) {
if (a.min.x < c.min.x) {
a.min.x = c.min.x;
}
if (a.min.y < c.min.y) {
a.min.y = c.min.y;
}
if (a.min.z < c.min.z) {
a.min.z = c.min.z;
}
if (a.max.x > c.max.x) {
a.max.x = c.max.x;
}
if (a.max.y > c.max.y) {
a.max.y = c.max.y;
}
if (a.max.z > c.max.z) {
a.max.z = c.max.z;
}
return a;
}
示例13: getBounds
import codechicken.lib.vec.Cuboid6; //导入依赖的package包/类
public Cuboid6 getBounds() {
switch (this.dir) {
case 0: {
return new Cuboid6(0.375, 0.0, 0.375, 0.625, (double)this.h, 0.625);
}
case 1: {
return new Cuboid6(0.375, (double)(1.0f - this.h), 0.375, 0.625, 1.0, 0.625);
}
case 2: {
return new Cuboid6(0.375, 0.375, 0.0, 0.625, 0.625, (double)this.h);
}
case 3: {
return new Cuboid6(0.375, 0.375, (double)(1.0f - this.h), 0.625, 0.625, 1.0);
}
case 4: {
return new Cuboid6(0.0, 0.375, 0.375, (double)this.h, 0.625, 0.625);
}
case 5: {
return new Cuboid6((double)(1.0f - this.h), 0.375, 0.375, 1.0, 0.625, 0.625);
}
default: {
return new Cuboid6(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
}
}
}
示例14: renderFluidCuboid
import codechicken.lib.vec.Cuboid6; //导入依赖的package包/类
/**
* Renders a fluid within a bounding box.
* If the fluid is a liquid it will render as a normal tank with height equal to density/bound.height.
* If the fluid is a gas, it will render the full box with an alpha equal to density.
* Warning, bound will be mutated if the fluid is a liquid
* @param stack The fluid to render.
* @param bound The box within which the fluid is contained.
* @param density The volume of fluid / the capacity of the tank. For gases this determines the alpha, for liquids this determines the height.
* @param res The resolution to render at.
*/
public static void renderFluidCuboid(FluidStack stack, Cuboid6 bound, double density, double res)
{
if(!shouldRenderFluid(stack))
return;
int alpha = 255;
if(stack.getFluid().isGaseous())
alpha = (int) (fluidDensityToAlpha(density)*255);
else
bound.max.y = bound.min.y+(bound.max.y-bound.min.y)*density;
IIcon tex = prepareFluidRender(stack, alpha);
CCRenderState.startDrawing();
renderFluidCuboid(bound, tex, res);
CCRenderState.draw();
postFluidRender();
}
示例15: addBlockHitEffects
import codechicken.lib.vec.Cuboid6; //导入依赖的package包/类
public static void addBlockHitEffects(World world, Cuboid6 bounds, int side, IIcon icon, EffectRenderer effectRenderer)
{
float border = 0.1F;
Vector3 diff = bounds.max.copy().subtract(bounds.min).add(-2*border);
diff.x*=world.rand.nextDouble();
diff.y*=world.rand.nextDouble();
diff.z*=world.rand.nextDouble();
Vector3 pos = diff.add(bounds.min).add(border);
if (side == 0)
diff.y = bounds.min.y - border;
if (side == 1)
diff.y = bounds.max.y + border;
if (side == 2)
diff.z = bounds.min.z - border;
if (side == 3)
diff.z = bounds.max.z + border;
if (side == 4)
diff.x = bounds.min.x - border;
if (side == 5)
diff.x = bounds.max.x + border;
effectRenderer.addEffect(
new EntityDigIconFX(world, pos.x, pos.y, pos.z, 0, 0, 0, icon)
.multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F));
}