Skip to content

Commit

Permalink
Edit README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tf2mandeokyi committed May 6, 2024
1 parent cc997e4 commit f13b359
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 22 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ See [API Documentation](YML_CONFIG.md) for more information.
./gradlew :core:build

# Building for specific MC versions:
# Cleaning is to refresh the core subproject dependency.
./gradlew :fabric1.18.2:clean
./gradlew :fabric1.18.2:build

# Building for all available MC versions:
Expand Down
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -338,9 +338,12 @@ subprojects { p ->

from "${project.projectDir}/build/libs"
into "${rootProject.projectDir}/build/libs"

dependsOn('build')
}
tasks.named('build').configure { finalizedBy(copyBuildResultToRoot) }
tasks.named('build').configure {
finalizedBy('copyBuildResultToRoot')
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.mndk.bteterrarenderer.ogc3dtiles;

import com.fasterxml.jackson.databind.json.JsonMapper;
import com.mndk.bteterrarenderer.core.BTETerraRendererConstants;
import lombok.experimental.UtilityClass;

@UtilityClass
public class Ogc3dTiles {

public JsonMapper jsonMapper() {
return BTETerraRendererConstants.JSON_MAPPER;
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.mndk.bteterrarenderer.ogc3dtiles;

import com.mndk.bteterrarenderer.core.BTETerraRendererConstants;
import com.mndk.bteterrarenderer.core.util.BTRUtil;
import com.mndk.bteterrarenderer.core.util.IOUtil;
import com.mndk.bteterrarenderer.ogc3dtiles.b3dm.Batched3DModel;
Expand Down Expand Up @@ -47,12 +46,11 @@ else if(BTRUtil.arrayStartsWith(byteArray, GLTF_START)) {
}
else if (BTRUtil.arrayStartsWith(byteArray, UTF8_BOM)) {
ByteBuf buf = Unpooled.wrappedBuffer(byteArray, 3, byteArray.length - 3);
result = BTETerraRendererConstants.JSON_MAPPER
.readValue((InputStream) new ByteBufInputStream(buf), Tileset.class);
result = Ogc3dTiles.jsonMapper().readValue((InputStream) new ByteBufInputStream(buf), Tileset.class);
}
else {
String jsonTry = new String(byteArray);
result = BTETerraRendererConstants.JSON_MAPPER.readValue(jsonTry, Tileset.class);
result = Ogc3dTiles.jsonMapper().readValue(jsonTry, Tileset.class);
}

return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.mndk.bteterrarenderer.core.BTETerraRendererConstants;
import com.mndk.bteterrarenderer.ogc3dtiles.Ogc3dTiles;
import com.mndk.bteterrarenderer.ogc3dtiles.math.Cartesian3;
import com.mndk.bteterrarenderer.ogc3dtiles.table.BinaryJsonTableElement;
import com.mndk.bteterrarenderer.ogc3dtiles.table.BinaryVector;
Expand All @@ -19,8 +19,7 @@ public class B3dmFeatureTable {
@Nullable private final Cartesian3 rtcCenter;

public static B3dmFeatureTable from(String json, byte[] binary) throws JsonProcessingException {
RawFeatureTableJson jsonParsed =
BTETerraRendererConstants.JSON_MAPPER.readValue(json, RawFeatureTableJson.class);
RawFeatureTableJson jsonParsed = Ogc3dTiles.jsonMapper().readValue(json, RawFeatureTableJson.class);
int batchLength = jsonParsed.batchLength.getValue(binary);

Cartesian3 rtcCenter = jsonParsed.rtcCenter == null ? null :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class CesiumRTC {
private final Cartesian3 center;

@JsonCreator
public CesiumRTC(@JsonProperty Cartesian3 center) {
public CesiumRTC(@JsonProperty(value = "center") Cartesian3 center) {
this.center = center;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.mndk.bteterrarenderer.ogc3dtiles.gltf.extensions;

import com.mndk.bteterrarenderer.core.BTETerraRendererConstants;
import com.mndk.bteterrarenderer.ogc3dtiles.Ogc3dTiles;
import de.javagl.jgltf.model.ModelElement;
import lombok.experimental.UtilityClass;

Expand All @@ -14,7 +14,7 @@ private <T> T getExtension(ModelElement modelElement, String extensionName, Clas
if(extensions == null || !extensions.containsKey(extensionName)) return null;
Object result = extensions.get(extensionName);
if(result == null) return null;
return BTETerraRendererConstants.JSON_MAPPER.convertValue(result, clazz);
return Ogc3dTiles.jsonMapper().convertValue(result, clazz);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ public class Web3dQuantizedAttributes {
private final Cartesian3 decodedMax;

@JsonCreator
public Web3dQuantizedAttributes(
@JsonProperty("decodeMatrix") Matrix4 decodeMatrix,
@JsonProperty("decodedMin") Cartesian3 decodedMin,
@JsonProperty("decodedMax") Cartesian3 decodedMax
) {
public Web3dQuantizedAttributes(@JsonProperty(value = "decodeMatrix") Matrix4 decodeMatrix,
@JsonProperty(value = "decodedMin") Cartesian3 decodedMin,
@JsonProperty(value = "decodedMax") Cartesian3 decodedMax) {
this.decodeMatrix = decodeMatrix;
this.decodedMin = decodedMin;
this.decodedMax = decodedMax;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.mndk.bteterrarenderer.core.BTETerraRendererConstants;
import com.mndk.bteterrarenderer.ogc3dtiles.Ogc3dTiles;
import com.mndk.bteterrarenderer.ogc3dtiles.math.Cartesian3;
import com.mndk.bteterrarenderer.ogc3dtiles.math.Spheroid3;
import com.mndk.bteterrarenderer.ogc3dtiles.table.BinaryJsonTableElement;
Expand All @@ -23,8 +23,7 @@ public class I3dmFeatureTable {
private final Instance[] instances;

public static I3dmFeatureTable from(String json, byte[] binary) throws JsonProcessingException {
RawFeatureTableJson jsonParsed =
BTETerraRendererConstants.JSON_MAPPER.readValue(json, RawFeatureTableJson.class);
RawFeatureTableJson jsonParsed = Ogc3dTiles.jsonMapper().readValue(json, RawFeatureTableJson.class);

Cartesian3 rtcCenter = jsonParsed.globalRtcCenter == null ? null :
Cartesian3.fromArray(jsonParsed.globalRtcCenter.getValue(binary).getElements());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.mndk.bteterrarenderer.core.BTETerraRendererConstants;
import com.mndk.bteterrarenderer.ogc3dtiles.Ogc3dTiles;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;

Expand All @@ -25,8 +25,7 @@ public class BatchTable implements Iterable<BatchTable.Row> {
private final List<Object[]> columns = new ArrayList<>();

public static BatchTable from(int batchModelCount, String json, byte[] binary) throws JsonProcessingException {
RawBatchTableJson rawBatchTableJson = BTETerraRendererConstants.JSON_MAPPER
.readValue(json, RawBatchTableJson.class);
RawBatchTableJson rawBatchTableJson = Ogc3dTiles.jsonMapper().readValue(json, RawBatchTableJson.class);
BatchTable batchTable = new BatchTable(batchModelCount);

rawBatchTableJson.forEach((columnName, tableElement) ->
Expand Down

0 comments on commit f13b359

Please sign in to comment.