Package appeng.api.parts

Examples of appeng.api.parts.IPartCollisionHelper


    if ( fp != null )
    {
      if ( !(side == null || side == ForgeDirection.UNKNOWN || tile() == null) )
      {
        List<AxisAlignedBB> boxes = new ArrayList<AxisAlignedBB>();
        IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true );
        fp.getBoxes( bch, null );
        for (AxisAlignedBB bb : boxes)
        {
          disableFacadeOcclusion.set( true );
          boolean canAdd = tile().canAddPart( new NormallyOccludedPart( new Cuboid6( bb ) ) );
          disableFacadeOcclusion.remove();
          if ( !canAdd )
          {
            return false;
          }
        }
      }
      return true;
    }

    if ( is.getItem() instanceof IPartItem )
    {
      IPartItem bi = (IPartItem) is.getItem();

      is = is.copy();
      is.stackSize = 1;

      IPart bp = bi.createPartFromItemStack( is );
      if ( !(side == null || side == ForgeDirection.UNKNOWN || tile() == null) )
      {
        List<AxisAlignedBB> boxes = new ArrayList<AxisAlignedBB>();
        IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true );
        bp.getBoxes( bch );
        for (AxisAlignedBB bb : boxes)
        {
          if ( !tile().canAddPart( new NormallyOccludedPart( new Cuboid6( bb ) ) ) )
          {
View Full Code Here


    List<AxisAlignedBB> boxes = new LinkedList<AxisAlignedBB>();

    IFacadeContainer fc = getFacadeContainer();
    for (ForgeDirection s : ForgeDirection.values())
    {
      IPartCollisionHelper bch = new BusCollisionHelper( boxes, s, e, visual );

      IPart part = getPart( s );
      if ( part != null )
      {
        if ( ignoreCableConnections && part instanceof IPartCable )
          bch.addBox( 6.0, 6.0, 6.0, 10.0, 10.0, 10.0 );
        else
          part.getBoxes( bch );
      }

      if ( AEApi.instance().partHelper().getCableRenderMode().opaqueFacades || !visual )
View Full Code Here

      IPart p = getPart( side );
      if ( p != null )
      {
        List<AxisAlignedBB> boxes = new LinkedList<AxisAlignedBB>();

        IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true );
        p.getBoxes( bch );
        for (AxisAlignedBB bb : boxes)
        {
          bb = bb.expand( 0.002, 0.002, 0.002 );
          if ( bb.isVecInside( pos ) )
          {
            return new SelectedPart( p, side );
          }
        }
      }
    }

    if ( AEApi.instance().partHelper().getCableRenderMode().opaqueFacades )
    {
      IFacadeContainer fc = getFacadeContainer();
      for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
      {
        IFacadePart p = fc.getFacade( side );
        if ( p != null )
        {
          List<AxisAlignedBB> boxes = new LinkedList<AxisAlignedBB>();

          IPartCollisionHelper bch = new BusCollisionHelper( boxes, side, null, true );
          p.getBoxes( bch, null );
          for (AxisAlignedBB bb : boxes)
          {
            bb = bb.expand( 0.01, 0.01, 0.01 );
            if ( bb.isVecInside( pos ) )
View Full Code Here

TOP

Related Classes of appeng.api.parts.IPartCollisionHelper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.