-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make lines slightly easier to see from all angles
- Loading branch information
1 parent
7624d89
commit e4ecdcf
Showing
4 changed files
with
42 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 16 additions & 2 deletions
18
src/main/java/mods/railcraft/client/util/LineRenderer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,30 @@ | ||
package mods.railcraft.client.util; | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import net.minecraft.world.phys.Vec3; | ||
import org.joml.Vector3f; | ||
|
||
public interface LineRenderer { | ||
static LineRenderer create(MultiBufferSource bufferSource) { | ||
return new SimpleLineRenderer(bufferSource); | ||
} | ||
|
||
default void renderLine(PoseStack poseStack, int color, Vec3 from, Vec3 to) { | ||
renderLine(poseStack, | ||
RenderUtil.getRed(color), RenderUtil.getGreen(color), RenderUtil.getBlue(color), 1, | ||
RenderUtil.getRed(color), RenderUtil.getGreen(color), RenderUtil.getBlue(color), | ||
(float) from.x, (float) from.y, (float) from.z, | ||
(float) to.x, (float) to.y, (float) to.z | ||
); | ||
} | ||
|
||
void renderLine(PoseStack poseStack, float r, float g, float b, float a, float x0, float y0, float z0, float x1, float y1, float z1); | ||
default void renderLine(PoseStack poseStack, int color, Vector3f from, Vector3f to) { | ||
renderLine(poseStack, | ||
RenderUtil.getRed(color), RenderUtil.getGreen(color), RenderUtil.getBlue(color), | ||
from.x, from.y, from.z, | ||
to.x, to.y, to.z | ||
); | ||
} | ||
|
||
void renderLine(PoseStack poseStack, float r, float g, float b, float x0, float y0, float z0, float x1, float y1, float z1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters