本文整理匯總了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;
}