Example #1
0
        /// <summary>
        /// Perform a vector rejection of every occupied cell from DirectionNorm and store the results in rejectionCells.
        /// </summary>
        private void rejectAll()
        {
            using (m_lock_rejcectionCells.AcquireExclusiveUsing())
            {
                m_rejectionCells.Clear();

                m_centreRejection = RejectMetres(Centre);
                m_cellCache.ForEach(cell => {
                    Vector3 rejection = RejectMetres(cell * m_grid.GridSize);
                    m_rejectionCells.Add(rejection);
                });
            }
        }
Example #2
0
        }                                                                 // RejectCell(myCubeGrid.WorldToGridInteger(metresPosition)); }

        /// <summary>
        /// Perform a vector rejection of every occupied cell from DirectionNorm and store the results in rejectionCells.
        /// </summary>
        private void rejectAll()
        {
            VRage.Exceptions.ThrowIf <ArgumentNullException>(DirectionNorm == null, "DirectionNorm");
            rejectionCells = new MyUniqueList <Vector3>();

            ReadOnlyList <IMySlimBlock> immutable;

            using (lock_SlimBlocks.AcquireSharedUsing())
                immutable = SlimBlocks.immutable();

            CentreRejection = RejectMetres(Centre);
            foreach (IMySlimBlock slim in immutable)
            {
                slim.ForEachCell((cell) => {
                    Vector3 rejection = RejectMetres(cell * myCubeGrid.GridSize);
                    rejectionCells.Add(rejection);
                    return(false);
                });
            }
        }