当前位置: 首页>>代码示例>>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;未经允许,请勿转载。