internal static void QueueJobCancel(MyWorkTracker <MyCellCoord, MyPrecalcJobPhysicsPrefetch> tracker, MyCellCoord id)
 {
     ThreadCommandBuffer.Add(new JobCancelCommand
     {
         Tracker = tracker,
         Id      = id,
     });
 }
Exemple #2
0
        internal MyVoxelPhysicsBody(MyVoxelBase voxelMap, float phantomExtend, float predictionSize = 3f, bool lazyPhysics = false) : base(voxelMap, RigidBodyFlag.RBF_STATIC)
        {
            this.RunningBatchTask     = new MyPrecalcJobPhysicsBatch[2];
            this.m_nearbyEntities     = new HashSet <IMyEntity>();
            this.m_nearbyEntitiesLock = new FastResourceLock();
            this.m_workTracker        = new MyWorkTracker <MyCellCoord, MyPrecalcJobPhysicsPrefetch>(MyCellCoord.Comparer);
            this.m_cellsOffset        = new Vector3I(0, 0, 0);
            this.m_staticForCluster   = true;
            this.m_predictionSize     = 3f;
            this.m_queuedRange        = new BoundingBoxI(-1, -1);
            this.InvalidCells         = new HashSet <Vector3I>[] { new HashSet <Vector3I>(), new HashSet <Vector3I>() };
            this.m_predictionSize     = predictionSize;
            this.m_phantomExtend      = phantomExtend;
            this.m_voxelMap           = voxelMap;
            Vector3I vectori1 = this.m_voxelMap.Size >> 3;

            this.m_cellsOffset = this.m_voxelMap.StorageMin >> 3;
            if (!MyFakes.ENABLE_LAZY_VOXEL_PHYSICS || !lazyPhysics)
            {
                this.CreateRigidBodies();
            }
            base.MaterialType = VRage.Game.MyMaterialType.ROCK;
        }