當前位置: 首頁>>代碼示例>>Java>>正文


Java IPartOccluding類代碼示例

本文整理匯總了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);
}
 
開發者ID:Qmunity,項目名稱:QmunityLib,代碼行數:29,代碼來源:FMPPart.java

示例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;
}
 
開發者ID:Qmunity,項目名稱:QmunityLib,代碼行數:13,代碼來源:FMPPart.java

示例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;
    }
 
開發者ID:Qmunity,項目名稱:QmunityLib,代碼行數:15,代碼來源:OcclusionHelper.java

示例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;
    }
 
開發者ID:Qmunity,項目名稱:QmunityLib,代碼行數:11,代碼來源:TileMultipart.java


注:本文中的uk.co.qmunity.lib.part.IPartOccluding類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。