net.minecraft.util.math.AxisAlignedBB.addCoord()方法的使用及代码示例

x33g5p2x  于11个月前 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(20)

本文整理了Java中net.minecraft.util.math.AxisAlignedBB.addCoord()方法的一些代码示例,展示了AxisAlignedBB.addCoord()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AxisAlignedBB.addCoord()方法的具体详情如下:
包路径:net.minecraft.util.math.AxisAlignedBB
类名称:AxisAlignedBB
方法名:addCoord

AxisAlignedBB.addCoord介绍

暂无

代码示例

代码示例来源:origin: MightyPirates/TIS-3D

@Nullable
private RayTraceResult checkEntityCollision(final World world, final Vec3d start, final Vec3d target) {
  RayTraceResult entityHit = null;
  double bestSqrDistance = Double.POSITIVE_INFINITY;
  final List<Entity> collisions = world.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().addCoord(motionX, motionY, motionZ));
  for (final Entity entity : collisions) {
    if (entity.canBeCollidedWith()) {
      final AxisAlignedBB entityBounds = entity.getEntityBoundingBox();
      final RayTraceResult hit = entityBounds.calculateIntercept(start, target);
      if (hit != null) {
        final double sqrDistance = start.squareDistanceTo(hit.hitVec);
        if (sqrDistance < bestSqrDistance) {
          hit.entityHit = entity;
          hit.typeOfHit = RayTraceResult.Type.ENTITY;
          entityHit = hit;
          bestSqrDistance = sqrDistance;
        }
      }
    }
  }
  return entityHit;
}

代码示例来源:origin: joshiejack/Mariculture

List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().addCoord(motionX, motionY, motionZ).expandXyz(1.0D));
double d0 = 0.0D;

代码示例来源:origin: PenguinSquad/Harvest-Festival

List<Entity> list = world.getEntitiesWithinAABBExcludingEntity(this, getEntityBoundingBox().addCoord(motionX, motionY, motionZ).expandXyz(1.0D));
double d0 = 0.0D;

代码示例来源:origin: Mine-and-blade-admin/Battlegear2

Vec3d vec33 = null;
Entity pointedEntity = null;
List<Entity> list = mc.world.getEntitiesInAABBexcluding(mc.getRenderViewEntity(), mc.getRenderViewEntity().getEntityBoundingBox().addCoord(vec31.xCoord * d0, vec31.yCoord * d0, vec31.zCoord * d0).expand(1.0D, 1.0D, 1.0D), Predicates.and(new Predicate<Entity>() {
  @Override
  public boolean apply(@Nullable Entity input) {

相关文章