Refactored json
This commit is contained in:
@@ -24,7 +24,7 @@ public class ObjModel {
|
|||||||
public static final Map<Identifier, ObjModel> loadedObjModels = new HashMap<>();
|
public static final Map<Identifier, ObjModel> loadedObjModels = new HashMap<>();
|
||||||
|
|
||||||
public record Config(
|
public record Config(
|
||||||
@JsonProperty("transform") Vec3d transform,
|
@JsonProperty("translate") Vec3d transform,
|
||||||
@JsonProperty("scale") Vec3d scale) {
|
@JsonProperty("scale") Vec3d scale) {
|
||||||
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
|
@JsonFormat(shape = JsonFormat.Shape.ARRAY)
|
||||||
@@ -79,8 +79,8 @@ public class ObjModel {
|
|||||||
matrices.multiply(net.minecraft.util.math.RotationAxis.POSITIVE_Y.rotationDegrees(180.0f));
|
matrices.multiply(net.minecraft.util.math.RotationAxis.POSITIVE_Y.rotationDegrees(180.0f));
|
||||||
|
|
||||||
if (this.config != null) {
|
if (this.config != null) {
|
||||||
matrices.scale(config.scale.x, config.scale.y, config.scale.z);
|
|
||||||
matrices.translate(config.transform.x, config.transform.y, config.transform.z);
|
matrices.translate(config.transform.x, config.transform.y, config.transform.z);
|
||||||
|
matrices.scale(config.scale.x, config.scale.y, config.scale.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjRenderer.renderObj(this.obj, mtlMap, matrices, vertexConsumers, light, overlay);
|
ObjRenderer.renderObj(this.obj, mtlMap, matrices, vertexConsumers, light, overlay);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"transform": [0.0, 3.0, 0.0],
|
"translate": [0.0, 0.62, 0.0],
|
||||||
"scale": [0.25, 0.25, 0.25]
|
"scale": [0.2, 0.1, 0.2]
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"transform": [0.0, 1.0, 0.0],
|
"translate": [0.0, 0.25, 0.0],
|
||||||
"scale": [0.25, 0.25, 0.25]
|
"scale": [0.25, 0.25, 0.25]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user