pub fn simulate(
        &mut self,
        time_step: f32,
        completion_task: Option<&mut PxBaseTask>,
        // scratch memory must be 16-align, 16K blocks
        scratch: Option<&mut [[(u64, u64); 1024]]>,
    ) {
        let completion_task = if let Some(task) = completion_task {
            task
        } else {
            null_mut()
        };

        let (scratch_ptr, scratch_size) = if let Some(scratch) = scratch {
            (
                scratch.as_mut_ptr() as *mut std::ffi::c_void,
                (scratch.len() * 16_384) as u32,
            )
        } else {
            (null_mut(), 0)
        };

        unsafe {
            PxScene_simulate_mut(
                self.as_mut_ptr(),
                time_step,
                completion_task,
                scratch_ptr,
                scratch_size,
                true,
            );
        }
    }
////////////////////////////////////////////////////////////////////////////////
// Simulation
// TODO write a proper type for the scratch buffer.
Simulation
TODO write a proper type for the scratch buffer.
Simulation TODO write a proper type for the scratch buffer .
pub fn simulate(
        &mut self,
        time_step: f32,
        completion_task: Option<&mut PxBaseTask>,
        // scratch memory must be 16-align, 16K blocks
        scratch: Option<&mut [[(u64, u64); 1024]]>,
    ) {
        let completion_task = if let Some(task) = completion_task {
            task
        } else {
            null_mut()
        };
        let (scratch_ptr, scratch_size) = if let Some(scratch) = scratch {
            (
                scratch.as_mut_ptr() as *mut std::ffi::c_void,
                (scratch.len() * 16_384) as u32,
            )
        } else {
            (null_mut(), 0)
        };
        unsafe {
            PxScene_simulate_mut(
                self.as_mut_ptr(),
                time_step,
                completion_task,
                scratch_ptr,
                scratch_size,
                true,
            );
        }
    }
pub fn simulate ( & mut self , time_step : f32 , completion_task : Option < & mut PxBaseTask > , // scratch memory must be 16-align, 16K blocks scratch : Option < & mut [ [ ( u64 , u64 ) ; 1024 ] ] > , ) { let completion_task = if let Some ( task ) = completion_task { task } else { null_mut ( ) } ; let ( scratch_ptr , scratch_size ) = if let Some ( scratch ) = scratch { ( scratch . as_mut_ptr ( ) as * mut std :: ffi :: c_void , ( scratch . len ( ) * 16_384 ) as u32 , ) } else { ( null_mut ( ) , 0 ) } ; unsafe { PxScene_simulate_mut ( self . as_mut_ptr ( ) , time_step , completion_task , scratch_ptr , scratch_size , true , ) ; } }
Simulation
TODO write a proper type for the scratch buffer.
Simulation TODO write a proper type for the scratch buffer .
&mut self
time_step
f32
completion_task
Option<&mut PxBaseTask>
scratch
Option<&mut [[(u64, u64); 1024]]>