Package team.lodestar.lodestone.helpers
Class VecHelper
java.lang.Object
team.lodestar.lodestone.helpers.VecHelper
A collection of methods designed to simplify and unify the use of vectors
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.phys.Vec3axisAlignedPlaneOf(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.Vec3getCenterOf(net.minecraft.core.Vec3i pos) static net.minecraft.world.phys.Vec3projectToPlayerView(net.minecraft.world.phys.Vec3 target, float partialTicks) static net.minecraft.world.phys.Vec3radialOffset(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 positionstatic net.minecraft.world.phys.Vec3rotate(net.minecraft.world.phys.Vec3 vec, double deg, net.minecraft.core.Direction.Axis axis) static net.minecraft.world.phys.Vec3rotatingRadialOffset(net.minecraft.world.phys.Vec3 pos, float distance, float current, float total, float gameTime, float timePerRotation) A method that returns a single position on the perimeter of a circle around a given Vec3 position.static net.minecraft.world.phys.Vec3rotatingRadialOffset(net.minecraft.world.phys.Vec3 pos, float distanceX, float distanceZ, float current, float total, float gameTime, float timePerRotation) 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 distance, float total, float gameTime, float timePerRotation) A method that returns an array list of positions 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, float gameTime, float timePerRotation) A method that returns an array list of positions on the perimeter of a sphere around a given Vec3 position.
-
Field Details
-
CENTER_OF_ORIGIN
public static final net.minecraft.world.phys.Vec3 CENTER_OF_ORIGIN
-
-
Constructor Details
-
VecHelper
public VecHelper()
-
-
Method Details
-
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 circledistance- - Defines the radius of your circlecurrent- - Defines the current point we are calculating the position for on the circletotal- - 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, float gameTime, float timePerRotation) 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 circledistance- - Defines the radius of your circletotal- - Defines the total amount of points in the circlegameTime- - Defines the current game time valuetimePerRotation- - 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, float gameTime, float timePerRotation) 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, float gameTime, float timePerRotation) 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, float gameTime, float timePerRotation) 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)
-