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

Function triangular_prism

perro_source/core/perro_builtin_meshes/src/lib.rs:243–258  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

241}
242
243fn triangular_prism() -> (Vec<BuiltinMeshVertex>, Vec<u16>) {
244 let mut vertices = Vec::new();
245 let mut indices = Vec::new();
246 let a0 = [-0.5, -0.5, -0.4];
247 let a1 = [0.5, -0.5, -0.4];
248 let a2 = [0.0, 0.5, -0.4];
249 let b0 = [-0.5, -0.5, 0.4];
250 let b1 = [0.5, -0.5, 0.4];
251 let b2 = [0.0, 0.5, 0.4];
252 push_triangle(&mut vertices, &mut indices, a0, a1, a2);
253 push_triangle(&mut vertices, &mut indices, b0, b2, b1);
254 push_quad(&mut vertices, &mut indices, a0, b0, b1, a1);
255 push_quad(&mut vertices, &mut indices, a1, b1, b2, a2);
256 push_quad(&mut vertices, &mut indices, a2, b2, b0, a0);
257 (vertices, indices)
258}
259
260fn cylinder(segments: u32) -> (Vec<BuiltinMeshVertex>, Vec<u16>) {
261 let seg = segments.max(3);

Callers 1

build_builtin_meshFunction · 0.85

Calls 2

push_triangleFunction · 0.85
push_quadFunction · 0.85

Tested by

no test coverage detected