Esempio n. 1
0
        internal static JobHandle ScheduleIntegrateJobs(ref PhysicsWorld physicsWorld, JobHandle inputDeps, int threadCountHint = 0)
        {
            var job = new ParallelIntegrateMotionsJob
            {
                BodyMotionData     = physicsWorld.BodyMotionData,
                BodyMotionVelocity = physicsWorld.BodyMotionVelocity,
                TimeStep           = physicsWorld.TimeStep,
            };

            return(job.Schedule(physicsWorld.DynamicsWorld.BodyMotionCount, 64, inputDeps));
        }
Esempio n. 2
0
 // 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)
 {
     if (threadCountHint <= 0)
     {
         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));
     }
 }
Esempio n. 3
0
 // Schedule a job to integrate the world's motions forward by the given time step.
 internal static JobHandle ScheduleIntegrateJobs(ref DynamicsWorld world, sfloat 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));
     }
 }