Skip to content

Commit 8fc7161

Browse files
authored
Merge pull request #180 from LadyCailin/add-bounding-box-to-json-exporter
Add bounding box information to the json output
2 parents 1948c4a + 44c062a commit 8fc7161

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

exporters/jsonExporter/jsonConstructor.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ interface ISerializedNode {
4949
entity_type?: string
5050
custom_model_data?: number
5151
resource_location?: string
52+
bounding_box?: THREE.Box3
5253
}
5354

5455
interface ISerializedVariant {
@@ -109,6 +110,7 @@ function serializeNodeMap(
109110
case 'bone': {
110111
const custom_model_data = node.customModelData
111112
const resource_location = node.resourceLocation
113+
const bounding_box = node.boundingBox
112114

113115
serializedNodeMap[uuid] = {
114116
type,
@@ -117,6 +119,7 @@ function serializeNodeMap(
117119
nbt: node.nbt,
118120
custom_model_data,
119121
resource_location,
122+
bounding_box: bounding_box,
120123
}
121124

122125
break

exporters/jsonExporter/jsonStructure.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,40 @@
8181
},
8282
"entity_type": {
8383
"type": "string"
84+
},
85+
"bounding_box": {
86+
"type": "object",
87+
"description": "The bounding box of the bone.",
88+
"properties": {
89+
"min": {
90+
"type": "object",
91+
"properties": {
92+
"x": {
93+
"type": "number"
94+
},
95+
"y": {
96+
"type": "number"
97+
},
98+
"z": {
99+
"type": "number"
100+
}
101+
}
102+
},
103+
"max": {
104+
"type": "object",
105+
"properties": {
106+
"x": {
107+
"type": "number"
108+
},
109+
"y": {
110+
"type": "number"
111+
},
112+
"z": {
113+
"type": "number"
114+
}
115+
}
116+
}
117+
}
84118
}
85119
}
86120
},

0 commit comments

Comments
 (0)