Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(joml): migrate KallistiDisplayComponent #1

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import org.terasology.kallisti.oc.OCTextRenderer;
import org.terasology.kcomputers.KComputersUtil;
import org.terasology.kcomputers.assets.HexFont;
import org.terasology.math.JomlUtil;
import org.terasology.math.Side;
import org.terasology.math.geom.Vector3f;
import org.terasology.network.NoReplicate;
Expand Down Expand Up @@ -170,7 +171,7 @@ public void blit(Image image) {
}

for (int i = 0; i < meshPart.size(); i++) {
Vector3f v = new Vector3f(meshPart.getVertex(i));
Vector3f v = JomlUtil.from(meshPart.getVertex(i));
// reduce by border size
Vector3f reduction = new Vector3f(
1 - (candidate.borderThickness * 2 * (1 - Math.abs(side.getVector3i().x))),
Expand All @@ -183,7 +184,7 @@ public void blit(Image image) {

meshBuilder.addVertex(v.sub(.5f, .5f, .5f));
meshBuilder.addColor(Color.WHITE);
meshBuilder.addTexCoord(meshPart.getTexCoord(i));
meshBuilder.addTexCoord(JomlUtil.from(meshPart.getTexCoord(i)));
}

component.mesh = meshBuilder.build();
Expand Down