Skip to content

Commit

Permalink
Merge pull request #180 from LadyCailin/add-bounding-box-to-json-expo…
Browse files Browse the repository at this point in the history
…rter

Add bounding box information to the json output
  • Loading branch information
SnaveSutit authored Mar 16, 2024
2 parents 1948c4a + 44c062a commit 8fc7161
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions exporters/jsonExporter/jsonConstructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ interface ISerializedNode {
entity_type?: string
custom_model_data?: number
resource_location?: string
bounding_box?: THREE.Box3
}

interface ISerializedVariant {
Expand Down Expand Up @@ -109,6 +110,7 @@ function serializeNodeMap(
case 'bone': {
const custom_model_data = node.customModelData
const resource_location = node.resourceLocation
const bounding_box = node.boundingBox

serializedNodeMap[uuid] = {
type,
Expand All @@ -117,6 +119,7 @@ function serializeNodeMap(
nbt: node.nbt,
custom_model_data,
resource_location,
bounding_box: bounding_box,
}

break
Expand Down
34 changes: 34 additions & 0 deletions exporters/jsonExporter/jsonStructure.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,40 @@
},
"entity_type": {
"type": "string"
},
"bounding_box": {
"type": "object",
"description": "The bounding box of the bone.",
"properties": {
"min": {
"type": "object",
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
}
},
"max": {
"type": "object",
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
}
}
}
}
}
},
Expand Down

0 comments on commit 8fc7161

Please sign in to comment.