INNER CODE UNIT · C++
center
oxylusengine/Oxylus · ResourceCompiler/private/ModelCompiler.cpp:457
const auto center = (mesh_bb_max + mesh_bb_min) * 0.5f;
const auto extent = mesh_bb_max - mesh_bb_min;
mesh.bounds_center[0] = center.x;
mesh.bounds_center[1] = center.y;
mesh.bounds_center[2] = center.z;
mesh.bounds_extent[0] = extent.x;
mesh.bounds_extent[1] = extent.y;
mesh.bounds_extent[2] = extent.z;
}
cur_lod.indices = blob_append(mesh.blob, simplified_indices, 8);
cur_lod.meshlets = blob_append(mesh.blob, meshlets, 8);
cur_lod.meshlet_bounds = blob_append(mesh.blob, gpu_meshlet_bounds, 8);
cur_lod.local_triangle_indices = blob_append(mesh.blob, local_triangle_indices, 8);
cur_lod.indirect_vertex_indices = blob_append(mesh.blob, indirect_vertex_indices, 4);
cur_lod.indices_count = static_cast<u32>(simplified_indices.size());
cur_lod.meshlet_count = static_cast<u32>(meshlet_count);