Class VecHelper

java.lang.Object
com.simibubi.create.foundation.utility.VecHelper

public class VecHelper extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.world.phys.Vec3
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static net.minecraft.world.phys.Vec3
    axisAlingedPlaneOf(net.minecraft.core.Direction face)
     
    static net.minecraft.world.phys.Vec3
    axisAlingedPlaneOf(net.minecraft.world.phys.Vec3 vec)
     
    static net.minecraft.world.phys.Vec3
    bezier(net.minecraft.world.phys.Vec3 p1, net.minecraft.world.phys.Vec3 p2, net.minecraft.world.phys.Vec3 q1, net.minecraft.world.phys.Vec3 q2, float t)
     
    static net.minecraft.world.phys.Vec3
    bezierDerivative(net.minecraft.world.phys.Vec3 p1, net.minecraft.world.phys.Vec3 p2, net.minecraft.world.phys.Vec3 q1, net.minecraft.world.phys.Vec3 q2, float t)
     
    static net.minecraft.world.phys.Vec3
    clamp(net.minecraft.world.phys.Vec3 vec, float maxLength)
     
    static net.minecraft.world.phys.Vec3
    clampComponentWise(net.minecraft.world.phys.Vec3 vec, float maxLength)
     
    static net.minecraft.world.phys.Vec3
    getCenterOf(net.minecraft.core.Vec3i pos)
     
    static int
    getCoordinate(net.minecraft.core.Vec3i pos, net.minecraft.core.Direction.Axis axis)
     
    static float
    getCoordinate(net.minecraft.world.phys.Vec3 vec, net.minecraft.core.Direction.Axis axis)
     
    static double[]
    intersect(net.minecraft.world.phys.Vec3 p1, net.minecraft.world.phys.Vec3 p2, net.minecraft.world.phys.Vec3 r, net.minecraft.world.phys.Vec3 s, net.minecraft.core.Direction.Axis plane)
     
    static double[]
    intersectRanged(net.minecraft.world.phys.Vec3 p1, net.minecraft.world.phys.Vec3 q1, net.minecraft.world.phys.Vec3 p2, net.minecraft.world.phys.Vec3 q2, net.minecraft.core.Direction.Axis plane)
     
    static net.minecraft.world.phys.Vec3
    intersectSphere(net.minecraft.world.phys.Vec3 origin, net.minecraft.world.phys.Vec3 lineDirection, net.minecraft.world.phys.Vec3 sphereCenter, double radius)
     
    static boolean
    isVecPointingTowards(net.minecraft.world.phys.Vec3 vec, net.minecraft.core.Direction direction)
     
    static net.minecraft.world.phys.Vec3
    lerp(float p, net.minecraft.world.phys.Vec3 from, net.minecraft.world.phys.Vec3 to)
     
    static net.minecraft.world.phys.Vec3
    lookAt(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.phys.Vec3 fwd)
     
    static net.minecraft.world.phys.Vec3
    mirror(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.level.block.Mirror mirror)
     
    static net.minecraft.world.phys.Vec3
    mirrorCentered(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.level.block.Mirror mirror)
     
    static net.minecraft.world.phys.Vec3
    offsetRandomly(net.minecraft.world.phys.Vec3 vec, Random r, float radius)
     
    static boolean
    onSameAxis(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2, net.minecraft.core.Direction.Axis axis)
     
    static net.minecraft.world.phys.Vec3
    project(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.phys.Vec3 ontoVec)
     
    static net.minecraft.world.phys.Vec3
    projectToPlayerView(net.minecraft.world.phys.Vec3 target, float partialTicks)
     
    static net.minecraft.world.phys.Vec3
    read(net.minecraft.network.FriendlyByteBuf buffer)
     
    static net.minecraft.world.phys.Vec3
    readNBT(net.minecraft.nbt.ListTag list)
     
    static net.minecraft.world.phys.Vec3
    readNBTCompound(net.minecraft.nbt.CompoundTag nbt)
     
    static net.minecraft.world.phys.Vec3
    rotate(net.minecraft.world.phys.Vec3 vec, double xRot, double yRot, double zRot)
     
    static net.minecraft.world.phys.Vec3
    rotate(net.minecraft.world.phys.Vec3 vec, double deg, net.minecraft.core.Direction.Axis axis)
     
    static net.minecraft.world.phys.Vec3
    rotate(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.phys.Vec3 rotationVec)
     
    static net.minecraft.world.phys.Vec3
    rotateCentered(net.minecraft.world.phys.Vec3 vec, double deg, net.minecraft.core.Direction.Axis axis)
     
    static net.minecraft.world.phys.Vec3
    slerp(float p, net.minecraft.world.phys.Vec3 from, net.minecraft.world.phys.Vec3 to)
     
    static net.minecraft.world.phys.Vec3
    voxelSpace(double x, double y, double z)
     
    static void
    write(net.minecraft.world.phys.Vec3 vec, net.minecraft.network.FriendlyByteBuf buffer)
     
    static net.minecraft.nbt.ListTag
    writeNBT(net.minecraft.world.phys.Vec3 vec)
     
    static net.minecraft.nbt.CompoundTag
    writeNBTCompound(net.minecraft.world.phys.Vec3 vec)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CENTER_OF_ORIGIN

      public static final net.minecraft.world.phys.Vec3 CENTER_OF_ORIGIN
  • Constructor Details

    • VecHelper

      public VecHelper()
  • Method Details

    • rotate

      public static net.minecraft.world.phys.Vec3 rotate(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.phys.Vec3 rotationVec)
    • rotate

      public static net.minecraft.world.phys.Vec3 rotate(net.minecraft.world.phys.Vec3 vec, double xRot, double yRot, double zRot)
    • rotateCentered

      public static net.minecraft.world.phys.Vec3 rotateCentered(net.minecraft.world.phys.Vec3 vec, double deg, net.minecraft.core.Direction.Axis axis)
    • rotate

      public static net.minecraft.world.phys.Vec3 rotate(net.minecraft.world.phys.Vec3 vec, double deg, net.minecraft.core.Direction.Axis axis)
    • mirrorCentered

      public static net.minecraft.world.phys.Vec3 mirrorCentered(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.level.block.Mirror mirror)
    • mirror

      public static net.minecraft.world.phys.Vec3 mirror(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.level.block.Mirror mirror)
    • lookAt

      public static net.minecraft.world.phys.Vec3 lookAt(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.phys.Vec3 fwd)
    • isVecPointingTowards

      public static boolean isVecPointingTowards(net.minecraft.world.phys.Vec3 vec, net.minecraft.core.Direction direction)
    • getCenterOf

      public static net.minecraft.world.phys.Vec3 getCenterOf(net.minecraft.core.Vec3i pos)
    • offsetRandomly

      public static net.minecraft.world.phys.Vec3 offsetRandomly(net.minecraft.world.phys.Vec3 vec, Random r, float radius)
    • axisAlingedPlaneOf

      public static net.minecraft.world.phys.Vec3 axisAlingedPlaneOf(net.minecraft.world.phys.Vec3 vec)
    • axisAlingedPlaneOf

      public static net.minecraft.world.phys.Vec3 axisAlingedPlaneOf(net.minecraft.core.Direction face)
    • writeNBT

      public static net.minecraft.nbt.ListTag writeNBT(net.minecraft.world.phys.Vec3 vec)
    • writeNBTCompound

      public static net.minecraft.nbt.CompoundTag writeNBTCompound(net.minecraft.world.phys.Vec3 vec)
    • readNBT

      public static net.minecraft.world.phys.Vec3 readNBT(net.minecraft.nbt.ListTag list)
    • readNBTCompound

      public static net.minecraft.world.phys.Vec3 readNBTCompound(net.minecraft.nbt.CompoundTag nbt)
    • write

      public static void write(net.minecraft.world.phys.Vec3 vec, net.minecraft.network.FriendlyByteBuf buffer)
    • read

      public static net.minecraft.world.phys.Vec3 read(net.minecraft.network.FriendlyByteBuf buffer)
    • voxelSpace

      public static net.minecraft.world.phys.Vec3 voxelSpace(double x, double y, double z)
    • getCoordinate

      public static int getCoordinate(net.minecraft.core.Vec3i pos, net.minecraft.core.Direction.Axis axis)
    • getCoordinate

      public static float getCoordinate(net.minecraft.world.phys.Vec3 vec, net.minecraft.core.Direction.Axis axis)
    • onSameAxis

      public static boolean onSameAxis(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2, net.minecraft.core.Direction.Axis axis)
    • clamp

      public static net.minecraft.world.phys.Vec3 clamp(net.minecraft.world.phys.Vec3 vec, float maxLength)
    • lerp

      public static net.minecraft.world.phys.Vec3 lerp(float p, net.minecraft.world.phys.Vec3 from, net.minecraft.world.phys.Vec3 to)
    • slerp

      public static net.minecraft.world.phys.Vec3 slerp(float p, net.minecraft.world.phys.Vec3 from, net.minecraft.world.phys.Vec3 to)
    • clampComponentWise

      public static net.minecraft.world.phys.Vec3 clampComponentWise(net.minecraft.world.phys.Vec3 vec, float maxLength)
    • project

      public static net.minecraft.world.phys.Vec3 project(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.phys.Vec3 ontoVec)
    • intersectSphere

      @Nullable public static net.minecraft.world.phys.Vec3 intersectSphere(net.minecraft.world.phys.Vec3 origin, net.minecraft.world.phys.Vec3 lineDirection, net.minecraft.world.phys.Vec3 sphereCenter, double radius)
    • projectToPlayerView

      public static net.minecraft.world.phys.Vec3 projectToPlayerView(net.minecraft.world.phys.Vec3 target, float partialTicks)
    • bezier

      public static net.minecraft.world.phys.Vec3 bezier(net.minecraft.world.phys.Vec3 p1, net.minecraft.world.phys.Vec3 p2, net.minecraft.world.phys.Vec3 q1, net.minecraft.world.phys.Vec3 q2, float t)
    • bezierDerivative

      public static net.minecraft.world.phys.Vec3 bezierDerivative(net.minecraft.world.phys.Vec3 p1, net.minecraft.world.phys.Vec3 p2, net.minecraft.world.phys.Vec3 q1, net.minecraft.world.phys.Vec3 q2, float t)
    • intersectRanged

      @Nullable public static double[] intersectRanged(net.minecraft.world.phys.Vec3 p1, net.minecraft.world.phys.Vec3 q1, net.minecraft.world.phys.Vec3 p2, net.minecraft.world.phys.Vec3 q2, net.minecraft.core.Direction.Axis plane)
    • intersect

      @Nullable public static double[] intersect(net.minecraft.world.phys.Vec3 p1, net.minecraft.world.phys.Vec3 p2, net.minecraft.world.phys.Vec3 r, net.minecraft.world.phys.Vec3 s, net.minecraft.core.Direction.Axis plane)