MCPcopy Create free account
hub / github.com/crownengine/crown / parse_node

Function parse_node

src/resource/mesh_resource.cpp:233–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231 s32 parse_nodes(Mesh &m, const char *sjson, CompileOptions &opts);
232
233 s32 parse_node(Node &n, const char *sjson, Mesh *mesh, CompileOptions &opts)
234 {
235 TempAllocator4096 ta;
236 JsonObject obj(ta);
237 RETURN_IF_ERROR(sjson::parse(obj, sjson));
238
239 n._local_pose = RETURN_IF_ERROR(sjson::parse_matrix4x4(obj["matrix_local"]));
240
241 if (json_object::has(obj, "children")) {
242 s32 err = mesh::parse_nodes(*mesh, obj["children"], opts);
243 ENSURE_OR_RETURN(MESH_RESOURCE, err == 0, opts);
244 }
245
246 if (json_object::has(obj, "geometry")) {
247 RETURN_IF_ERROR(sjson::parse_string(n._geometry, obj["geometry"]));
248 }
249
250 return 0;
251 }
252
253 s32 parse_indices(Geometry &g, const char *json, CompileOptions &opts)
254 {

Callers 1

parse_nodesFunction · 0.70

Calls 5

parse_matrix4x4Function · 0.85
parseFunction · 0.70
parse_nodesFunction · 0.70
hasFunction · 0.50
parse_stringFunction · 0.50

Tested by

no test coverage detected