Class VecHelper

java.lang.Object
team.lodestar.lodestone.helpers.VecHelper

public class VecHelper extends Object
A collection of methods designed to simplify and unify the use of vectors
  • 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
    axisAlignedPlaneOf(net.minecraft.world.phys.Vec3 vec)
     
    static ArrayList<net.minecraft.world.phys.Vec3>
    blockOutlinePositions(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
     
    static net.minecraft.world.phys.Vec3
    getCenterOf(net.minecraft.core.Vec3i pos)
     
    static net.minecraft.core.Vec3i
    offsetDir(net.minecraft.core.Direction dir)
    A method that takes in a direction enum (E.G.
    static net.minecraft.world.phys.Vec3
    projectToPlayerView(net.minecraft.world.phys.Vec3 target, float partialTicks)
     
    static net.minecraft.world.phys.Vec3
    radialOffset(net.minecraft.world.phys.Vec3 pos, float distance, float current, float total)
    A method that returns a position on the perimeter of a circle around a given Vec3 position
    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
    rotatingRadialOffset(net.minecraft.world.phys.Vec3 pos, float distanceX, float distanceZ, float current, float total, long gameTime, float time)
    A method that returns a single position on the perimeter of a circle around a given Vec3 position.
    static net.minecraft.world.phys.Vec3
    rotatingRadialOffset(net.minecraft.world.phys.Vec3 pos, float distance, float current, float total, long gameTime, float time)
    A method that returns a single position on the perimeter of a circle around a given Vec3 position.
    static ArrayList<net.minecraft.world.phys.Vec3>
    rotatingRadialOffsets(net.minecraft.world.phys.Vec3 pos, float distanceX, float distanceZ, float total, long gameTime, float time)
    A method that returns an array list of positions on the perimeter of a sphere around a given Vec3 position.
    static ArrayList<net.minecraft.world.phys.Vec3>
    rotatingRadialOffsets(net.minecraft.world.phys.Vec3 pos, float distance, float total, long gameTime, float time)
    A method that returns an array list of positions on the perimeter of a circle around a given Vec3 position.

    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

    • offsetDir

      public static net.minecraft.core.Vec3i offsetDir(net.minecraft.core.Direction dir)
      A method that takes in a direction enum (E.G. "UP") and returns a Vec3i object facing that direction
    • radialOffset

      public static net.minecraft.world.phys.Vec3 radialOffset(net.minecraft.world.phys.Vec3 pos, float distance, float current, float total)
      A method that returns a position on the perimeter of a circle around a given Vec3 position
      Parameters:
      pos - - Defines the center of the circle
      distance - - Defines the radius of your circle
      current - - Defines the current point we are calculating the position for on the circle
      total - - Defines the total amount of points in the circle
    • rotatingRadialOffsets

      public static ArrayList<net.minecraft.world.phys.Vec3> rotatingRadialOffsets(net.minecraft.world.phys.Vec3 pos, float distance, float total, long gameTime, float time)
      A method that returns an array list of positions on the perimeter of a circle around a given Vec3 position. These positions constantly rotate around the center of the circle based on gameTime
      Parameters:
      pos - - Defines the center of the circle
      distance - - Defines the radius of your circle
      total - - Defines the total amount of points in the circle
      gameTime - - Defines the current game time value
      time - - Defines the total time for one position to complete a full rotation cycle
    • rotatingRadialOffsets

      public static ArrayList<net.minecraft.world.phys.Vec3> rotatingRadialOffsets(net.minecraft.world.phys.Vec3 pos, float distanceX, float distanceZ, float total, long gameTime, float time)
      A method that returns an array list of positions on the perimeter of a sphere around a given Vec3 position. These positions constantly rotate around the center of the circle based on gameTime.
    • rotatingRadialOffset

      public static net.minecraft.world.phys.Vec3 rotatingRadialOffset(net.minecraft.world.phys.Vec3 pos, float distance, float current, float total, long gameTime, float time)
      A method that returns a single position on the perimeter of a circle around a given Vec3 position. These positions constantly rotate around the center of the circle based on gameTime
    • rotatingRadialOffset

      public static net.minecraft.world.phys.Vec3 rotatingRadialOffset(net.minecraft.world.phys.Vec3 pos, float distanceX, float distanceZ, float current, float total, long gameTime, float time)
      A method that returns a single position on the perimeter of a circle around a given Vec3 position. These positions constantly rotate around the center of the circle based on gameTime
    • blockOutlinePositions

      public static ArrayList<net.minecraft.world.phys.Vec3> blockOutlinePositions(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
    • getCenterOf

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

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

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

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