MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / update_geometry_f64

Function update_geometry_f64

native/watchos/src/scene.rs:288–313  ·  view source on GitHub ↗
(handle: u32, verts: &[f64], indices: &[f64])

Source from the content-addressed store, hash-verified

286}
287
288pub fn update_geometry_f64(handle: u32, verts: &[f64], indices: &[f64]) {
289 mark_dirty(handle, DIRTY_GEOMETRY, |n| {
290 let count = verts.len() / 12;
291 n.positions.clear();
292 n.normals.clear();
293 n.uvs.clear();
294 n.positions.reserve(count * 3);
295 n.normals.reserve(count * 3);
296 n.uvs.reserve(count * 2);
297 for i in 0..count {
298 let base = i * 12;
299 n.positions.push(verts[base] as f32);
300 n.positions.push(verts[base+1] as f32);
301 n.positions.push(verts[base+2] as f32);
302 n.normals.push(verts[base+3] as f32);
303 n.normals.push(verts[base+4] as f32);
304 n.normals.push(verts[base+5] as f32);
305 n.uvs.push(verts[base+10] as f32);
306 n.uvs.push(verts[base+11] as f32);
307 }
308 n.indices.clear();
309 n.indices.reserve(indices.len());
310 for &i in indices { n.indices.push(i as u32); }
311 n.geometry_version = n.geometry_version.wrapping_add(1);
312 });
313}
314
315pub fn add_directional_light(dx: f32, dy: f32, dz: f32, r: f32, g: f32, b: f32, intensity: f32) {
316 with(|inner| {

Callers 1

Calls 3

mark_dirtyFunction · 0.85
clearMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected