本文整理汇总了Java中uk.co.qmunity.lib.part.IPartOccluding类的典型用法代码示例。如果您正苦于以下问题:Java IPartOccluding类的具体用法?Java IPartOccluding怎么用?Java IPartOccluding使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IPartOccluding类属于uk.co.qmunity.lib.part包,在下文中一共展示了IPartOccluding类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: canAddPart
import uk.co.qmunity.lib.part.IPartOccluding; //导入依赖的package包/类
@Override
public boolean canAddPart(IPart part) {
if (tile() == null)
return true;
if (part instanceof IPartCollidable) {
List<Vec3dCube> cubes = new ArrayList<Vec3dCube>();
((IPartCollidable) part).addCollisionBoxesToList(cubes, null);
for (Vec3dCube c : cubes)
if (!getWorld().checkNoEntityCollision(c.clone().add(getX(), getY(), getZ()).toAABB()))
return false;
}
if (part instanceof IPartOccluding) {
for (Vec3dCube b : ((IPartOccluding) part).getOcclusionBoxes()) {
NormallyOccludedPart nop = new NormallyOccludedPart(new Cuboid6(b.toAABB()));
try {
if (!tile().canAddPart(nop))
return false;
} catch (Exception ex) {
return false;
}
}
}
return OcclusionHelper.occlusionTest(this, part);
}
示例2: getOcclusionBoxes
import uk.co.qmunity.lib.part.IPartOccluding; //导入依赖的package包/类
@Override
public Iterable<Cuboid6> getOcclusionBoxes() {
List<Cuboid6> cubes = new ArrayList<Cuboid6>();
for (IPart p : getParts())
if (p != null && p instanceof IPartOccluding)
for (Vec3dCube c : ((IPartOccluding) p).getOcclusionBoxes())
cubes.add(new IndexedCuboid6(0, new Cuboid6(c.toAABB())));
return cubes;
}
示例3: occlusionTest
import uk.co.qmunity.lib.part.IPartOccluding; //导入依赖的package包/类
public static boolean occlusionTest(IPart part, IPart part2) {
if (part instanceof IPartOccluding && part2 instanceof IPartOccluding) {
IPartOccluding p1 = (IPartOccluding) part;
IPartOccluding p2 = (IPartOccluding) part2;
for (Vec3dCube c1 : p1.getOcclusionBoxes())
for (Vec3dCube c2 : p2.getOcclusionBoxes())
if (!c1.occlusionTest(c2))
return false;
}
return true;
}
示例4: getOcclusionBoxes
import uk.co.qmunity.lib.part.IPartOccluding; //导入依赖的package包/类
public List<Vec3dCube> getOcclusionBoxes() {
List<Vec3dCube> boxes = new ArrayList<Vec3dCube>();
for (IPart p : getParts())
if (p instanceof IPartOccluding)
boxes.addAll(((IPartOccluding) p).getOcclusionBoxes());
return boxes;
}