use of net.minecraft.util.math.Vector4f in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method isPointVisible.
public static boolean isPointVisible(double x, double y, double z) {
FrustramAccessor frustum = (FrustramAccessor) getFrustum();
Vector4f[] frustumCoords = frustum.getHomogeneousCoordinates();
Vector4f pos = new Vector4f((float) (x - frustum.getX()), (float) (y - frustum.getY()), (float) (z - frustum.getZ()), 1f);
for (int i = 0; i < 6; ++i) {
if (frustumCoords[i].dotProduct(pos) <= 0f) {
return false;
}
}
return true;
}
use of net.minecraft.util.math.Vector4f in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method getRenderPosition.
public static Vec3d getRenderPosition(Vec3d vec3d, MatrixStack matrixStack) {
Matrix4f matrix = matrixStack.peek().getPositionMatrix();
double minX = vec3d.getX() - mc.getEntityRenderDispatcher().camera.getPos().x;
double minY = vec3d.getY() - mc.getEntityRenderDispatcher().camera.getPos().y;
double minZ = vec3d.getZ() - mc.getEntityRenderDispatcher().camera.getPos().z;
Vector4f vector4f = new Vector4f((float) minX, (float) minY, (float) minZ, 1.f);
vector4f.transform(matrix);
return new Vec3d(vector4f.getX(), vector4f.getY(), vector4f.getZ());
}
use of net.minecraft.util.math.Vector4f in project KiwiClient by TangyKiwi.
the class FrustumUtils method isPointVisible.
public static boolean isPointVisible(double x, double y, double z) {
FrustrumAccessor frustum = (FrustrumAccessor) getFrustum();
Vector4f[] frustumCoords = frustum.getHomogeneousCoordinates();
Vector4f pos = new Vector4f((float) (x - frustum.getX()), (float) (y - frustum.getY()), (float) (z - frustum.getZ()), 1f);
for (int i = 0; i < 6; ++i) {
if (frustumCoords[i].dotProduct(pos) <= 0f) {
return false;
}
}
return true;
}
use of net.minecraft.util.math.Vector4f in project BleachHack by BleachDrinker420.
the class FrustumUtils method isPointVisible.
public static boolean isPointVisible(double x, double y, double z) {
AccessorFrustum frustum = (AccessorFrustum) getFrustum();
Vector4f[] frustumCoords = frustum.getHomogeneousCoordinates();
Vector4f pos = new Vector4f((float) (x - frustum.getX()), (float) (y - frustum.getY()), (float) (z - frustum.getZ()), 1f);
for (int i = 0; i < 6; ++i) {
if (frustumCoords[i].dotProduct(pos) <= 0f) {
return false;
}
}
return true;
}
use of net.minecraft.util.math.Vector4f in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method getPos.
public static Vec3d getPos(Entity entity, float yOffset, float partialTicks, MatrixStack matrixStack) {
Vec3d bound = getEntityRenderPosition(entity, partialTicks).add(0, yOffset, 0);
Vector4f vector4f = new Vector4f((float) bound.x, (float) bound.y, (float) bound.z, 1.f);
vector4f.transform(matrixStack.peek().getPositionMatrix());
Vec3d twoD = to2D(vector4f.getX(), vector4f.getY(), vector4f.getZ());
return new Vec3d(twoD.x, twoD.y, twoD.z);
}
Aggregations