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

Function parse_geometries

src/resource/mesh_obj.cpp:193–217  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191 }
192
193 static s32 parse_geometries(Mesh &m, const ufbx_mesh_list *meshes, CompileOptions &opts)
194 {
195 for (size_t i = 0; i < meshes->count; ++i) {
196 const ufbx_mesh *mesh = meshes->data[i];
197 Geometry geo(default_allocator());
198
199 if (mesh->num_faces == 0)
200 continue;
201
202 s32 err = parse_geometry(geo, mesh);
203 ENSURE_OR_RETURN(OBJ_RESOURCE, err == 0, opts);
204
205 DynamicString geometry_name(default_allocator());
206 geometry_name.from_string_id(StringId32((const char *)&mesh, sizeof(mesh)));
207
208 RETURN_IF_FALSE(OBJ_RESOURCE, !hash_map::has(m._geometries, geometry_name)
209 , opts
210 , "Geometry redefined: '%s'"
211 , geometry_name.c_str()
212 );
213 hash_map::set(m._geometries, geometry_name, geo);
214 }
215
216 return 0;
217 }
218
219 static s32 parse_node(Node &n, const ufbx_node *node)
220 {

Callers 1

parse_internalFunction · 0.70

Calls 6

setClass · 0.85
from_string_idMethod · 0.80
parse_geometryFunction · 0.70
StringId32Class · 0.50
hasFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected