Class VecHelper
java.lang.Object
com.simibubi.create.foundation.utility.VecHelper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.phys.Vec3axisAlingedPlaneOf(net.minecraft.core.Direction face) static net.minecraft.world.phys.Vec3axisAlingedPlaneOf(net.minecraft.world.phys.Vec3 vec) static net.minecraft.world.phys.Vec3bezier(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.Vec3bezierDerivative(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.Vec3clamp(net.minecraft.world.phys.Vec3 vec, float maxLength) static net.minecraft.world.phys.Vec3clampComponentWise(net.minecraft.world.phys.Vec3 vec, float maxLength) static net.minecraft.world.phys.Vec3getCenterOf(net.minecraft.core.Vec3i pos) static intgetCoordinate(net.minecraft.core.Vec3i pos, net.minecraft.core.Direction.Axis axis) static floatgetCoordinate(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.Vec3intersectSphere(net.minecraft.world.phys.Vec3 origin, net.minecraft.world.phys.Vec3 lineDirection, net.minecraft.world.phys.Vec3 sphereCenter, double radius) static booleanisVecPointingTowards(net.minecraft.world.phys.Vec3 vec, net.minecraft.core.Direction direction) static net.minecraft.world.phys.Vec3lerp(float p, net.minecraft.world.phys.Vec3 from, net.minecraft.world.phys.Vec3 to) static net.minecraft.world.phys.Vec3lookAt(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.phys.Vec3 fwd) static net.minecraft.world.phys.Vec3mirror(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.level.block.Mirror mirror) static net.minecraft.world.phys.Vec3mirrorCentered(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.level.block.Mirror mirror) static net.minecraft.world.phys.Vec3offsetRandomly(net.minecraft.world.phys.Vec3 vec, Random r, float radius) static booleanonSameAxis(net.minecraft.core.BlockPos pos1, net.minecraft.core.BlockPos pos2, net.minecraft.core.Direction.Axis axis) static net.minecraft.world.phys.Vec3project(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.phys.Vec3 ontoVec) static net.minecraft.world.phys.Vec3projectToPlayerView(net.minecraft.world.phys.Vec3 target, float partialTicks) static net.minecraft.world.phys.Vec3read(net.minecraft.network.FriendlyByteBuf buffer) static net.minecraft.world.phys.Vec3readNBT(net.minecraft.nbt.ListTag list) static net.minecraft.world.phys.Vec3readNBTCompound(net.minecraft.nbt.CompoundTag nbt) static net.minecraft.world.phys.Vec3rotate(net.minecraft.world.phys.Vec3 vec, double xRot, double yRot, double zRot) static net.minecraft.world.phys.Vec3rotate(net.minecraft.world.phys.Vec3 vec, double deg, net.minecraft.core.Direction.Axis axis) static net.minecraft.world.phys.Vec3rotate(net.minecraft.world.phys.Vec3 vec, net.minecraft.world.phys.Vec3 rotationVec) static net.minecraft.world.phys.Vec3rotateCentered(net.minecraft.world.phys.Vec3 vec, double deg, net.minecraft.core.Direction.Axis axis) static net.minecraft.world.phys.Vec3slerp(float p, net.minecraft.world.phys.Vec3 from, net.minecraft.world.phys.Vec3 to) static net.minecraft.world.phys.Vec3voxelSpace(double x, double y, double z) static voidwrite(net.minecraft.world.phys.Vec3 vec, net.minecraft.network.FriendlyByteBuf buffer) static net.minecraft.nbt.ListTagwriteNBT(net.minecraft.world.phys.Vec3 vec) static net.minecraft.nbt.CompoundTagwriteNBTCompound(net.minecraft.world.phys.Vec3 vec)
-
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)
-