Class MultiIndexedVoxelShape

java.lang.Object
net.minecraft.world.phys.shapes.VoxelShape
codechicken.lib.raytracer.MultiIndexedVoxelShape

public class MultiIndexedVoxelShape extends net.minecraft.world.phys.shapes.VoxelShape
A VoxelShape implementation, produces a VoxelShapeBlockHitResult when ray traced. Whilst similar to IndexedVoxelShape, will ray trace each sub-component provided, returning the closest.

The sub-component will have its outline automatically rendered appropriately.

Created by covers1624 on 5/12/20.

  • Field Summary

    Fields inherited from class net.minecraft.world.phys.shapes.VoxelShape

    shape
  • Constructor Summary

    Constructors
    Constructor
    Description
    MultiIndexedVoxelShape(com.google.common.collect.ImmutableSet<IndexedVoxelShape> shapes)
    Construct a MultiIndexedVoxelShape, using the combination of all the sub-components as this VoxelShape.
    MultiIndexedVoxelShape(net.minecraft.world.phys.shapes.VoxelShape merged, com.google.common.collect.ImmutableSet<IndexedVoxelShape> shapes)
    Constructs a MultiIndexedVoxelShape, using the provided VoxelShape as this shape, whilst still RayTracing against all the sub-components.
  • Method Summary

    Modifier and Type
    Method
    Description
    clip(net.minecraft.world.phys.Vec3 start, net.minecraft.world.phys.Vec3 end, net.minecraft.core.BlockPos pos)
     
    it.unimi.dsi.fastutil.doubles.DoubleList
    getCoords(net.minecraft.core.Direction.Axis axis)
     

    Methods inherited from class net.minecraft.world.phys.shapes.VoxelShape

    bounds, closestPointTo, collide, collideX, findIndex, forAllBoxes, forAllEdges, get, getFaceShape, isEmpty, max, max, min, min, move, optimize, toAabbs, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MultiIndexedVoxelShape

      public MultiIndexedVoxelShape(com.google.common.collect.ImmutableSet<IndexedVoxelShape> shapes)
      Construct a MultiIndexedVoxelShape, using the combination of all the sub-components as this VoxelShape.
      Parameters:
      shapes - The sub-components.
    • MultiIndexedVoxelShape

      public MultiIndexedVoxelShape(net.minecraft.world.phys.shapes.VoxelShape merged, com.google.common.collect.ImmutableSet<IndexedVoxelShape> shapes)
      Constructs a MultiIndexedVoxelShape, using the provided VoxelShape as this shape, whilst still RayTracing against all the sub-components.
      Parameters:
      merged - The base shape.
      shapes - The sub-components.
  • Method Details

    • getCoords

      public it.unimi.dsi.fastutil.doubles.DoubleList getCoords(net.minecraft.core.Direction.Axis axis)
      Specified by:
      getCoords in class net.minecraft.world.phys.shapes.VoxelShape
    • clip

      @Nullable public VoxelShapeBlockHitResult clip(net.minecraft.world.phys.Vec3 start, net.minecraft.world.phys.Vec3 end, net.minecraft.core.BlockPos pos)
      Overrides:
      clip in class net.minecraft.world.phys.shapes.VoxelShape