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

Method step

native/shared/src/physics_jolt.rs:249–264  ·  view source on GitHub ↗
(&mut self, world_h: f64, dt: f32, collision_steps: u32)

Source from the content-addressed store, hash-verified

247 }
248
249 pub fn step(&mut self, world_h: f64, dt: f32, collision_steps: u32) {
250 if let Some(&world) = self.worlds.get(world_h) {
251 unsafe { bj_world_step(world, dt, collision_steps.max(1)); }
252 // Drain contact events into our cache so they survive across queries.
253 let count = unsafe { bj_world_contact_count(world) };
254 if count > 0 {
255 self.contact_cache.events.resize(count as usize, unsafe { std::mem::zeroed() });
256 let drained = unsafe {
257 bj_world_pop_contacts(world, self.contact_cache.events.as_mut_ptr(), count)
258 };
259 self.contact_cache.events.truncate(drained as usize);
260 } else {
261 self.contact_cache.events.clear();
262 }
263 }
264 }
265
266 pub fn set_layer_collides(&self, world_h: f64, a: u32, b: u32, collides: bool) {
267 if let Some(&world) = self.worlds.get(world_h) {

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
resizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected