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

Function parse_geometries

src/resource/mesh_fbx.cpp:177–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175 }
176
177 s32 parse_geometries(Mesh &m, FBXDocument &fbx, const ufbx_mesh_list *meshes, CompileOptions &opts)
178 {
179 for (size_t i = 0; i < meshes->count; ++i) {
180 const ufbx_mesh *mesh = meshes->data[i];
181 Geometry geo(default_allocator());
182
183 if (mesh->num_faces == 0)
184 continue;
185
186 s32 err = fbx::parse_geometry(geo, fbx, mesh);
187 ENSURE_OR_RETURN(FBX_RESOURCE, err == 0, opts);
188
189 DynamicString geometry_name(default_allocator());
190 geometry_name.from_string_id(StringId32((const char *)&mesh, sizeof(mesh)));
191
192 RETURN_IF_FALSE(FBX_RESOURCE, !hash_map::has(m._geometries, geometry_name)
193 , opts
194 , "Geometry redefined: '%s'"
195 , geometry_name.c_str()
196 );
197 hash_map::set(m._geometries, geometry_name, geo);
198 }
199
200 return 0;
201 }
202
203 s32 parse_node(Node &n, const ufbx_node *node)
204 {

Callers 1

parseFunction · 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