ProjectionType .java

com.mojang.blaze3d.ProjectionType (enum): members: PERSPECTIVE, ORTHOGRAPHIC, applyLayeringTransform, LayeringTransform, layeringTransform, vertexSorting.

com.mojang.blaze3denum35 linesclient1.1 KB

API Surface (2)

VertexSorting vertexSorting()
void applyLayeringTransform(final Matrix4f matrix, final float bias)

Fields & Constants (2)

vertexSorting
layeringTransform

Code Graph: Dependencies (1)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ProjectionType.java35 lines · Minecraft 26.3 · verbatim
1
package com.mojang.blaze3d;
2
3
import com.mojang.blaze3d.vertex.VertexSorting;
4
import net.fabricmc.api.EnvType;
5
import net.fabricmc.api.Environment;
6
import org.joml.Matrix4f;
7
8
@Environment(EnvType.CLIENT)
9
public enum ProjectionType {
10
	PERSPECTIVE(VertexSorting.DISTANCE_TO_ORIGIN, (matrix, bias) -> matrix.scale(1.0F - bias / 4096.0F)),
11
	ORTHOGRAPHIC(VertexSorting.ORTHOGRAPHIC_Z, (matrix, bias) -> matrix.translate(0.0F, 0.0F, bias / 512.0F));
12
13
	private final VertexSorting vertexSorting;
14
	private final ProjectionType.LayeringTransform layeringTransform;
15
16
	ProjectionType(final VertexSorting vertexSorting, final ProjectionType.LayeringTransform layeringTransform) {
17
		this.vertexSorting = vertexSorting;
18
		this.layeringTransform = layeringTransform;
19
	}
20
21
	public VertexSorting vertexSorting() {
22
		return this.vertexSorting;
23
	}
24
25
	public void applyLayeringTransform(final Matrix4f matrix, final float bias) {
26
		this.layeringTransform.apply(matrix, bias);
27
	}
28
29
	@FunctionalInterface
30
	@Environment(EnvType.CLIENT)
31
	private interface LayeringTransform {
32
		void apply(Matrix4f matrix, float bias);
33
	}
34
}
35

Decompiled Minecraft 26.3 source of ProjectionType (com/mojang/blaze3d/ProjectionType.java) with Mojang official mappings, stored verbatim on the site.