MCPcopy Create free account
hub / github.com/PerroEngine/Perro / build_builtin_mesh

Function build_builtin_mesh

perro_source/core/perro_builtin_meshes/src/lib.rs:49–64  ·  view source on GitHub ↗
(source: &str)

Source from the content-addressed store, hash-verified

47}
48
49pub fn build_builtin_mesh(source: &str) -> Option<BuiltinMesh> {
50 let (vertices, indices) = match source {
51 CUBE_SOURCE => cube(),
52 QUAD_SOURCE => quad(),
53 PLANE_SOURCE => plane(),
54 TRIANGULAR_PYRAMID_SOURCE => triangular_pyramid(),
55 SQUARE_PYRAMID_SOURCE => square_pyramid(),
56 SPHERE_SOURCE => sphere(ROUND_SEGMENTS, SPHERE_LATITUDE_BANDS),
57 TRIANGULAR_PRISM_SOURCE => triangular_prism(),
58 CYLINDER_SOURCE => cylinder(CYLINDER_SEGMENTS),
59 CONE_SOURCE => cone(ROUND_SEGMENTS),
60 CAPSULE_SOURCE => capsule(ROUND_SEGMENTS, CAPSULE_HEMISPHERE_BANDS),
61 _ => return None,
62 };
63 Some(BuiltinMesh { vertices, indices })
64}
65
66fn quad() -> (Vec<BuiltinMeshVertex>, Vec<u16>) {
67 (

Calls 10

cubeFunction · 0.85
quadFunction · 0.85
planeFunction · 0.85
triangular_pyramidFunction · 0.85
square_pyramidFunction · 0.85
sphereFunction · 0.85
triangular_prismFunction · 0.85
cylinderFunction · 0.85
coneFunction · 0.85
capsuleFunction · 0.85