// Integrate the world's motions forward by the given time step. public static void Integrate(NativeSlice <MotionData> motionDatas, NativeSlice <MotionVelocity> motionVelocities, float timeStep) { for (int i = 0; i < motionDatas.Length; i++) { IntegrateMotionsJob.ExecuteImpl(i, motionDatas, motionVelocities, timeStep); } }
// Schedule a job to integrate the world's motions forward by the given time step. internal static JobHandle ScheduleIntegrateJobs(ref DynamicsWorld world, float timeStep, JobHandle inputDeps, int threadCountHint = 0) { var job = new IntegrateMotionsJob { MotionDatas = world.MotionDatas, MotionVelocities = world.MotionVelocities, TimeStep = timeStep }; if (threadCountHint <= 0) { return(job.Schedule(inputDeps)); } else { return(job.Schedule(world.NumMotions, 64, inputDeps)); } }
// Schedule a job to integrate the world's motions forward by the given time step. internal static JobHandle ScheduleIntegrateJobs(ref DynamicsWorld world, float timeStep, JobHandle inputDeps, bool multiThreaded = true) { if (!multiThreaded) { var job = new IntegrateMotionsJob { MotionDatas = world.MotionDatas, MotionVelocities = world.MotionVelocities, TimeStep = timeStep }; return(job.Schedule(inputDeps)); } else { var job = new ParallelIntegrateMotionsJob { MotionDatas = world.MotionDatas, MotionVelocities = world.MotionVelocities, TimeStep = timeStep }; return(job.Schedule(world.NumMotions, 64, inputDeps)); } }